IdentityHashtable
has two parameters that
affect its efficiency: its capacity and its load
factor. The load factor should be between 0.0 and 1.0. When
the number of entries in the IdentityHashtable exceeds the product of the
load factor and the current capacity, the capacity is increased by
calling the rehash
method. Larger load factors use
memory more efficiently, at the expense of larger expected time
per lookup.
If many entries are to be made into a IdentityHashtable
,
creating it with a sufficiently large capacity may allow the
entries to be inserted more efficiently than letting it perform
automatic rehashing as needed to grow the table.
![]() |
Members | Description | ||
table | The hash table data.
|
|||
count | The total number of entries in the hash table.
|
|||
threshold | Rehashes the table when count exceeds this threshold.
|
|||
loadFactor | The load factor for the IdentityHashtable.
|
|||
IdentityHashtable | Constructs a new, empty IdentityHashtable with the specified initial
capacity and the specified load factor.
|
|||
IdentityHashtable | Constructs a new, empty IdentityHashtable with the specified initial
capacity and default load factor.
|
|||
IdentityHashtable | Constructs a new, empty IdentityHashtable with a default capacity and load
factor.
|
|||
size | Returns the number of keys in this IdentityHashtable.
|
|||
isEmpty | Tests if this IdentityHashtable maps no keys to values.
|
|||
contains | Tests if some key maps into the specified value in this IdentityHashtable.
This operation is more expensive than the containsKey
method.
|
|||
containsKey | Tests if the specified object is a key in this IdentityHashtable.
|
|||
get | Returns the value to which the specified key is mapped in this
IdentityHashtable.
|
|||
rehash | Rehashes the contents of the IdentityHashtable into a IdentityHashtable
with a larger capacity. This method is called automatically when the
number of keys in the IdentityHashtable exceeds this IdentityHashtable's
capacity and load factor.
|
|||
put | Maps the specified key to the specified
value in this IdentityHashtable. 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.
|
|||
remove | Removes the key (and its corresponding value) from this
IdentityHashtable. This method does nothing if the key is not in the
IdentityHashtable.
|
|||
clear | Clears this IdentityHashtable so that it contains no keys.
|