From 375d4f8756a5c729f7d5ba8bca9fd5be12e2e4c1 Mon Sep 17 00:00:00 2001 From: mdb Date: Thu, 6 Feb 2003 20:00:05 +0000 Subject: [PATCH] Add primitive iteration capabilities. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1052 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../java/com/samskivert/util/CheapIntMap.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/CheapIntMap.java b/projects/samskivert/src/java/com/samskivert/util/CheapIntMap.java index 92035d17..b3087797 100644 --- a/projects/samskivert/src/java/com/samskivert/util/CheapIntMap.java +++ b/projects/samskivert/src/java/com/samskivert/util/CheapIntMap.java @@ -1,5 +1,5 @@ // -// $Id: CheapIntMap.java,v 1.1 2003/02/06 19:57:29 mdb Exp $ +// $Id: CheapIntMap.java,v 1.2 2003/02/06 20:00:05 mdb Exp $ package com.samskivert.util; @@ -95,6 +95,24 @@ public class CheapIntMap Arrays.fill(_values, null); } + /** + * Returns the key with the specified index or -1 if no key exists at + * that index. + */ + public int getKey (int index) + { + return _keys[index]; + } + + /** + * Returns the value with the specified index or null if no value + * exists at that index. + */ + public Object getValue (int index) + { + return _values[index]; + } + protected int[] _keys; protected Object[] _values; }