Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
pack-priv final float | loadFactor
The load factor for the hash table. |
pack-priv transient int | modCount
The number of times this HashMap has been structurally modified Structural modifications are those that change the number of mappings in the HashMap or otherwise modify its internal structure (e.g., rehash). |
pack-priv transient int | size
The total number of mappings in the hash table. |
pack-priv transient LongHashMap. | table
The hash table data. |
pack-priv int | threshold
The table is rehashed when its size exceeds this threshold. |
Access | Constructor and Description |
---|---|
public | LongHashMap(int
the initial capacity of the HashMap. initialCapacity, float the load factor of the HashMap loadFactor)Constructs a new, empty map with the specified initial capacity and the specified load factor. |
public | LongHashMap(int
the initial capacity of the HashMap. initialCapacity)Constructs a new, empty map with the specified initial capacity and default load factor, which is 0.75. |
public |
Modifier and Type | Method and Description |
---|---|
pack-priv int | |
public void | |
public boolean | Returns: true if this map contains a mapping for the specified key.key whose presence in this Map is to be tested. key)Returns true if this map contains a mapping for the specified key. |
public boolean | Returns: true if this map maps one or more keys to the specified value.value whose presence in this map is to be tested. value)Returns true if this map maps one or more keys to the specified value. |
pack-priv static boolean | |
public Object | Returns: the value to which this map maps the specified key.key whose associated value is to be returned. key)Returns the value to which this map maps the specified key. |
pack-priv LongHashMap. | |
public boolean | Returns: true if this map contains no key-value mappings.Returns true if this map contains no key-value mappings. |
pack-priv float | |
pack-priv LongHashMap. | |
public Object | Returns: previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the HashMap previously associated null with the specified key.key with which the specified value is to be associated. key, Object value to be associated with the specified key. value)Associates the specified value with the specified key in this map. |
pack-priv void | |
public Object | Returns: previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key.key whose mapping is to be removed from the map. key)Removes the mapping for this key from this map if present. |
pack-priv void | removeEntry(LongHashMap.
Removes the specified entry from this HashMap (and increments modCount). |
pack-priv LongHashMap. | removeEntryForKey(long key)
Removes and returns the entry associated with the specified key in the HashMap. |
public int | Returns: the number of key-value mappings in this map.Returns the number of key-value mappings in this map. |
loadFactor | back to summary |
---|---|
pack-priv final float loadFactor The load factor for the hash table. |
modCount | back to summary |
---|---|
pack-priv transient int modCount The number of times this HashMap has been structurally modified Structural modifications are those that change the number of mappings in the HashMap or otherwise modify its internal structure (e.g., rehash). This field is used to make iterators on Collection-views of the HashMap fail-fast. (See ConcurrentModificationException). |
size | back to summary |
---|---|
pack-priv transient int size The total number of mappings in the hash table. |
table | back to summary |
---|---|
pack-priv transient LongHashMap. The hash table data. |
threshold | back to summary |
---|---|
pack-priv int threshold The table is rehashed when its size exceeds this threshold. (The value of this field is (int)(capacity * loadFactor).) |
LongHashMap | back to summary |
---|---|
public LongHashMap(int initialCapacity, float loadFactor) Constructs a new, empty map with the specified initial capacity and the specified load factor.
|
LongHashMap | back to summary |
---|---|
public LongHashMap(int initialCapacity) Constructs a new, empty map with the specified initial capacity and default load factor, which is 0.75.
|
LongHashMap | back to summary |
---|---|
public LongHashMap() Constructs a new, empty map with a default capacity and load factor, which is 0.75. |
capacity | back to summary |
---|---|
pack-priv int capacity() |
clear | back to summary |
---|---|
public void clear() Removes all mappings from this map. |
containsKey | back to summary |
---|---|
public boolean containsKey(long key) Returns true if this map contains a mapping for the specified key.
|
containsValue | back to summary |
---|---|
public boolean containsValue(Object value) Returns true if this map maps one or more keys to the specified value.
|
eq | back to summary |
---|---|
pack-priv static boolean eq(Object o1, Object o2) |
get | back to summary |
---|---|
public Object get(long key) Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.
|
getEntry | back to summary |
---|---|
pack-priv LongHashMap. Returns the entry associated with the specified key in the HashMap. Returns null if the HashMap contains no mapping for this key. |
isEmpty | back to summary |
---|---|
public boolean isEmpty() Returns true if this map contains no key-value mappings.
|
loadFactor | back to summary |
---|---|
pack-priv float loadFactor() |
newEntry | back to summary |
---|---|
pack-priv LongHashMap. |
put | back to summary |
---|---|
public Object put(long key, Object value) Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.
|
rehash | back to summary |
---|---|
pack-priv void rehash() Rehashes the contents of this map into a new HashMap instance with a larger capacity. This method is called automatically when the number of keys in this map exceeds its capacity and load factor. |
remove | back to summary |
---|---|
public Object remove(long key) Removes the mapping for this key from this map if present.
|
removeEntry | back to summary |
---|---|
pack-priv void removeEntry(LongHashMap. Removes the specified entry from this HashMap (and increments modCount).
|
removeEntryForKey | back to summary |
---|---|
pack-priv LongHashMap. Removes and returns the entry associated with the specified key in the HashMap. Returns null if the HashMap contains no mapping for this key. |
size | back to summary |
---|---|
public int size() Returns the number of key-value mappings in this map.
|
Modifier and Type | Field and Description |
---|---|
private int | |
private long | |
private LongHashMap. | |
private Object |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public boolean | Returns: true if the specified object is equal to this map entry.object to be compared for equality with this map entry. o)Overrides java. Compares the specified object with this entry for equality. |
pack-priv long | |
pack-priv Object | Returns: the value corresponding to this entry.Returns the value corresponding to this entry. |
public int | Returns: the hash code value for this map entry.Overrides java. Returns the hash code value for this map entry. |
pack-priv Object |
hash | back to summary |
---|---|
private int hash |
key | back to summary |
---|---|
private long key |
next | back to summary |
---|---|
private LongHashMap. |
value | back to summary |
---|---|
private Object value |
Entry | back to summary |
---|---|
pack-priv Entry(int hash, long key, Object value, LongHashMap. |
equals | back to summary |
---|---|
public boolean equals(Object o) Overrides java. Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping. More formally, two entries e1 and e2 represent the same mapping if (e1.getKey()==null ? e2.getKey()==null : e1.getKey().equals(e2.getKey())) && (e1.getValue()==null ? e2.getValue()==null : e1.getValue().equals(e2.getValue()))This ensures that the equals method works properly across different implementations of the Map.Entry interface.
|
getKey | back to summary |
---|---|
pack-priv long getKey() Returns the key corresponding to this entry.
|
getValue | back to summary |
---|---|
pack-priv Object getValue() Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Returns the hash code value for this map entry. The hash code of a map entry e is defined to be: (e.getKey()==null ? 0 : e.getKey().hashCode()) ^ (e.getValue()==null ? 0 : e.getValue().hashCode())This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.
|
setValue | back to summary |
---|---|
pack-priv Object setValue(Object value) Replaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).
|