public class IntHashMap
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
IntHashMap.Entry
This class represents a
IntHashMapentry. |
class |
IntHashMap.EntryIterator |
class |
IntHashMap.ValueIterator |
protected class |
IntHashMap.Values |
| Constructor and Description |
|---|
IntHashMap()
Creates an IntHashMap of small initial capacity.
|
IntHashMap(int capacity)
Creates an IntHashMap of specified initial capacity.
|
IntHashMap(IntHashMap map)
Creates a IntHashMap containing the specified entries, in the order they are
returned by the map's iterator.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEntry(int hash,
int key,
java.lang.Object value)
Adds a new entry for the specified key and value.
|
void |
clear()
Removes all mappings from this
IntHashMap. |
boolean |
containsKey(int key)
Indicates if this
IntHashMapcontains a mapping for the specified key. |
boolean |
containsValue(java.lang.Object value)
Indicates if this
IntHashMapmaps one or more keys to the specified value. |
IntHashMap.EntryIterator |
entryIterator() |
boolean |
equals(java.lang.Object obj)
Compares the specified object with this
IntHashMapfor equality. |
java.lang.Object |
get(int key)
Returns the value to which this
IntHashMapmaps the specified key. |
IntHashMap.Entry |
getEntry(int key)
Returns the entry with the specified key.
|
int |
hashCode()
Returns the hash code value for this
IntHashMap. |
IntHashMap.Entry |
headEntry()
Returns the head entry of this map.
|
boolean |
isEmpty()
Indicates if this
IntHashMapcontains no key-value mappings. |
org.apache.commons.collections.primitives.IntListIterator |
keyIterator() |
org.apache.commons.collections.primitives.IntCollection |
keys() |
protected IntHashMap.Entry |
newEntry()
Returns a new entry for this map; sub-classes may override this method to use
custom entries.
|
java.lang.Object |
put(int key,
java.lang.Object value)
Associates the specified value with the specified key in this
IntHashMap. |
void |
putAll(IntHashMap that)
Copies all of the mappings from the specified map to this
IntHashMap. |
java.lang.Object |
remove(int key)
Removes the mapping for this key from this
IntHashMapif present. |
void |
removeEntry(IntHashMap.Entry entry)
Removes the specified entry from the map.
|
int |
size()
Returns the number of key-value mappings in this
IntHashMap. |
IntHashMap.Entry |
tailEntry()
Returns the tail entry of this map.
|
java.lang.String |
toString()
Returns the textual representation of this
IntHashMap. |
IntHashMap.ValueIterator |
valueIterator()
Returns a list iterator over the values in this list in proper sequence, (this map
maintains the insertion order).
|
IntHashMap.Values |
values()
Returns a
RowCollectionview of the values contained in this
IntHashMap. |
public IntHashMap()
public IntHashMap(int capacity)
capacity - the initial capacity.public IntHashMap(IntHashMap map)
map - the map whose entries are to be placed into this map.public void clear()
IntHashMap.public final boolean containsKey(int key)
IntHashMapcontains a mapping for the specified key.key - the key whose presence in this map is to be tested.true if this map contains a mapping for the specified key;
false otherwise.public final boolean containsValue(java.lang.Object value)
IntHashMapmaps one or more keys to the specified value.value - the value whose presence in this map is to be tested.true if this map maps one or more keys to the specified
value.public IntHashMap.EntryIterator entryIterator()
public boolean equals(java.lang.Object obj)
IntHashMapfor equality. Returns
true if the given object is also a map and the two maps represent
the same mappings (regardless of collection iteration order).equals in class java.lang.Objectobj - the object to be compared for equality with this map.true if the specified object is equal to this map;
false otherwise.public final java.lang.Object get(int key)
IntHashMapmaps the specified key.key - the key whose associated value is to be returned.null
if there is no mapping for the key.public final IntHashMap.Entry getEntry(int key)
key - the key whose associated entry is to be returned.null if none.public int hashCode()
IntHashMap.hashCode in class java.lang.Objectpublic final IntHashMap.Entry headEntry()
headEntry().getNextEntry() holds the first
map entry.public final boolean isEmpty()
IntHashMapcontains no key-value mappings.true if this map contains no key-value mappings;
false otherwise.public org.apache.commons.collections.primitives.IntListIterator keyIterator()
public final java.lang.Object put(int key,
java.lang.Object value)
IntHashMap.
If the IntHashMappreviously contained a mapping for this key, the old value
is replaced.key - the key with which the specified value is to be associated.value - the value to be associated with the specified key.null if
there was no mapping for key. A null return can also
indicate that the map previously associated null with the
specified key.public final void putAll(IntHashMap that)
IntHashMap.map - the mappings to be stored in this map.public final java.lang.Object remove(int key)
IntHashMapif present.key - the key whose mapping is to be removed from the map.null if
there was no mapping for key. A null return can also
indicate that the map previously associated null with the
specified key.public void removeEntry(IntHashMap.Entry entry)
entry - the entry to be removed.public final IntHashMap.ValueIterator valueIterator()
public final int size()
IntHashMap.public final IntHashMap.Entry tailEntry()
tailEntry().getPreviousEntry() holds the
last map entry.public java.lang.String toString()
IntHashMap.toString in class java.lang.Objectpublic final IntHashMap.Values values()
RowCollectionview of the values contained in this
IntHashMap. The collection is backed by the map, so changes to the map are
reflected in the collection, and vice-versa. The collection supports element
removal, which removes the corresponding mapping from this map, via the
RowIterator.remove,RowCollection.remove and
clear operations.public org.apache.commons.collections.primitives.IntCollection keys()
protected IntHashMap.Entry newEntry()
protected void addEntry(int hash,
int key,
java.lang.Object value)
hash - the hash of the key, generated with #keyHash.key - the entry's key.value - the entry's value.