org.rapla.components.util
Class SmallIntMap

java.lang.Object
  extended by org.rapla.components.util.SmallIntMap
All Implemented Interfaces:
Serializable

public class SmallIntMap
extends Object
implements Serializable

Same as map but for small positive int-values.

This class is useful if you want to model a 1:1 relation between an int value and an object.

This map is only efficient for small ints because the hashMap size is always larger or equal to the largest key. It is optimized for get.

See Also:
get(int), Serialized Form

Constructor Summary
SmallIntMap()
           
SmallIntMap(int initSize)
           
SmallIntMap(int[] keys, Object[] values)
           
 
Method Summary
 void clear()
           
 int[] findMatchingKeys(Object value)
           
 Object get(int key)
           
 Set keySet()
           
 Object put(int key, Object value)
           
 Object remove(int key)
           
 Collection values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmallIntMap

public SmallIntMap()

SmallIntMap

public SmallIntMap(int initSize)

SmallIntMap

public SmallIntMap(int[] keys,
                   Object[] values)
Method Detail

get

public Object get(int key)

put

public Object put(int key,
                  Object value)

clear

public void clear()

remove

public Object remove(int key)

findMatchingKeys

public int[] findMatchingKeys(Object value)

keySet

public Set keySet()

values

public Collection values()


Copyright © 2000-2006 Rapla Team. All Rights Reseserved.