|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.web3d.util.ShortHashMap
A hash map that uses primitive shorts for the key rather than objects.
HashMap| Constructor Summary | |
ShortHashMap()
Constructs a new, empty hashtable with a default capacity and load factor, which is 20 and 0.75 respectively. |
|
ShortHashMap(int initialCapacity)
Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is 0.75. |
|
ShortHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty hashtable with the specified initial capacity and the specified load factor. |
|
| Method Summary | |
void |
clear()
Clears this hashtable so that it contains no keys. |
java.lang.Object |
clone()
Make a cloned copy of this class. |
boolean |
contains(java.lang.Object value)
Tests if some key maps into the specified value in this hashtable. |
boolean |
containsKey(short key)
Tests if the specified object is a key in this hashtable. |
boolean |
containsValue(java.lang.Object value)
Returns true if this HashMap maps one or more keys to this value. |
java.lang.Object |
get(short key)
Returns the value to which the specified key is mapped in this map. |
boolean |
isEmpty()
Tests if this hashtable maps no keys to values. |
short[] |
keySet()
Returns an array with all keys. |
short[] |
keySetSorted()
Returns a sorted array with all keys. |
java.lang.Object |
put(short key,
java.lang.Object value)
Maps the specified key to the specified
value in this hashtable. |
protected void |
rehash()
Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently. |
java.lang.Object |
remove(short key)
Removes the key (and its corresponding value) from this hashtable. |
int |
size()
Returns the number of keys in this hashtable. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ShortHashMap()
public ShortHashMap(int initialCapacity)
initialCapacity - the initial capacity of the hashtable.
java.lang.IllegalArgumentException - if the initial capacity is less
than zero.
public ShortHashMap(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity of the hashtable.loadFactor - the load factor of the hashtable.
java.lang.IllegalArgumentException - if the initial capacity is less
than zero, or if the load factor is nonpositive.| Method Detail |
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException - Something lower couldn't clonepublic int size()
public boolean isEmpty()
true if this hashtable maps no keys to values;
false otherwise.public boolean contains(java.lang.Object value)
containsKey
method.Note that this method is identical in functionality to containsValue, (which is part of the Map interface in the collections framework).
value - a value to search for.
true if and only if some key maps to the
value argument in this hashtable as
determined by the equals method;
false otherwise.
java.lang.NullPointerException - if the value is null.containsKey(short),
containsValue(Object),
Mappublic boolean containsValue(java.lang.Object value)
Note that this method is identical in functionality to contains (which predates the Map interface).
value - value whose presence in this HashMap is to be tested.Mappublic boolean containsKey(short key)
key - possible key.
true if and only if the specified object is a
key in this hashtable, as determined by the equals
method; false otherwise.contains(Object)public java.lang.Object get(short key)
key - a key in the hashtable.
null if the key is not mapped to any value in
this hashtable.put(short, Object)public short[] keySet()
public short[] keySetSorted()
protected void rehash()
public java.lang.Object put(short key,
java.lang.Object value)
key to the specified
value in this hashtable. Neither the key nor the
value can be null.
The value can be retrieved by calling the get method
with a key that is equal to the original key.
key - the hashtable key.value - the value.
null if it did not have one.
java.lang.NullPointerException - if the key or value is
null.get(short)public java.lang.Object remove(short key)
key - the key that needs to be removed.
null if the key did not have a mapping.public void clear()
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||