javax.baja.nre.util
Class LongHashMap

java.lang.Object
  extended byjavax.baja.nre.util.LongHashMap

public class LongHashMap
extends java.lang.Object

LongHashMap is an optimized hashtable for hashing objects by a long key. It removes the need to use wrapper Long as with the standard collection classes.


Nested Class Summary
 class LongHashMap.Iterator
           
 
Constructor Summary
LongHashMap()
          Default constructor.
LongHashMap(int initialCapacity)
          Constructor with initial capacity.
LongHashMap(int initialCapacity, float loadFactor)
          Constructor with initial capacity and load factor.
 
Method Summary
 void clear()
          Clear the hashtable of entries.
 java.lang.Object clone()
          Clone the IntHashMap into a new instance.
 boolean equals(java.lang.Object obj)
          Return if the specified object another LongHashMap with the exact same key-value pairs.
 java.lang.Object get(long key)
          Get the object identified by the given long key.
 boolean isEmpty()
           
 LongHashMap.Iterator iterator()
           
 java.lang.Object put(long key, java.lang.Object value)
          Put the given object into the table keyed on the long.
 java.lang.Object remove(long key)
          Remove the vaulue identified by the key.
 int size()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
          Get an array containing all values in hash table.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongHashMap

public LongHashMap()
Default constructor.


LongHashMap

public LongHashMap(int initialCapacity)
Constructor with initial capacity.


LongHashMap

public LongHashMap(int initialCapacity,
                   float loadFactor)
Constructor with initial capacity and load factor.

Method Detail

size

public int size()
Returns:
the count of elements in the table.

isEmpty

public boolean isEmpty()
Returns:
if the table is empty.

iterator

public LongHashMap.Iterator iterator()
Returns:
an iterator of the values for this table.

get

public java.lang.Object get(long key)
Get the object identified by the given long key.

Returns:
null if not in table.

put

public java.lang.Object put(long key,
                            java.lang.Object value)
Put the given object into the table keyed on the long.

Returns:
the previous value at this key, or null if it did not have one.

remove

public java.lang.Object remove(long key)
Remove the vaulue identified by the key.


clear

public void clear()
Clear the hashtable of entries.


equals

public boolean equals(java.lang.Object obj)
Return if the specified object another LongHashMap with the exact same key-value pairs.


clone

public java.lang.Object clone()
Clone the IntHashMap into a new instance.


toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Get an array containing all values in hash table.