Deprecated
will be removed in 4.0.0
null is not supported for keys or values.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private Object[] | mapArr
stores key-value pair as 2 objects; key first; in case of empty map this might be |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements java. Removes all of the mappings from this map (optional operation). |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. Returns |
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. Returns |
| public Set | entrySet()
Implements java. Returns a |
| private int | |
| private int | |
| public V | get(Object
the key whose associated value is to be returned key)Implements java. Returns the value to which the specified key is mapped,
or |
| public boolean | |
| public Set | |
| public V | put(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Implements java. Associates the specified value with the specified key in this map (optional operation). |
| public final void | putAll(Map<? extends K, ? extends V>
mappings to be stored in this map otherMap)Implements java. Copies all of the mappings from the specified map to this map (optional operation). |
| public V | remove(Object
key whose mapping is to be removed from the map key)Implements java. Removes the mapping for a key from this map if it is present (optional operation). |
| public int | |
| public Collection |
| mapArr | back to summary |
|---|---|
| private Object[] mapArr stores key-value pair as 2 objects; key first; in case of empty map this might be | |
| SmallMap | back to summary |
|---|---|
| public SmallMap() Creates empty map. | |
| SmallMap | back to summary |
|---|---|
| public SmallMap(Map<? extends K, ? extends V> initMap) Creates map filled with entries from provided map.
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Implements java. Doc from java. Returns | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Implements java. Doc from java. Returns | |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| findKey | back to summary |
|---|---|
| private int findKey(Object key) Returns index of key within map-array or | |
| findValue | back to summary |
|---|---|
| private int findValue(Object value) Returns index of value within map-array or | |
| get | back to summary |
|---|---|
| public V get(Object key) Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
If this map permits null values, then a return value of
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| keySet | back to summary |
|---|---|
| public Set Implements java. Returns a set view of the keys contained in this map. The current implementation does not allow changes to the returned key set (which would have to be reflected in the underlying map.
| |
| put | back to summary |
|---|---|
| public V put(K key, V value) Implements java. Doc from java. Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
| |
| putAll | back to summary |
|---|---|
| public final void putAll(Map<? extends K, ? extends V> otherMap) Implements java. Doc from java. Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling | |
| remove | back to summary |
|---|---|
| public V remove(Object key) Implements java. Doc from java. Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns. | |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of key-value mappings in this map. If the
map contains more than
| |
| values | back to summary |
|---|---|
| public Collection Implements java. Returns a collection of the values contained in this map. The current implementation does not allow changes to the returned collection (which would have to be reflected in the underlying map.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
object to be compared for equality with this map entry obj)Overrides java. Implements java. Compares the specified object with this entry for equality. |
| public K | |
| public V | |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this map entry. |
| public V | setValue(V
new value to be stored in this entry value)Implements java. Replaces the value corresponding to this entry with the specified value (optional operation). |
| keyIdx | back to summary |
|---|---|
| private final int keyIdx | |
| SmallMapEntry | back to summary |
|---|---|
| pack-priv SmallMapEntry(int keyInMapIdx) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Implements java. Doc from java. Compares the specified object with this entry for equality.
Returns
(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 |
|---|---|
| public K getKey() Implements java. Doc from java. Returns the key corresponding to this entry.
| |
| getValue | back to summary |
|---|---|
| public V getValue() Implements java. Doc from java. Returns the value corresponding to this entry. If the mapping
has been removed from the backing map (by the iterator's
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this map entry. The hash code
of a map entry
(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 |
|---|---|
| public V setValue(V value) Implements java. Doc from java. 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
| |