HashMap implementation backed by an ArrayList to preserve order of values.
Implementation properties are:
java.lang.Object#hashCode() for O(1) operations, see below.com.jogamp.common.util.locks.RecursiveLock .
| Modifier and Type | Field and Description |
|---|---|
| private final ArrayList | |
| public static final int | DEFAULT_INITIAL_CAPACITY
The default initial capacity: |
| public static final float | DEFAULT_LOAD_FACTOR
Default load factor: |
| private final HashMap | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | ArrayHashMap(final boolean
Use supportNullValue, final int true for default behavior, i.e. null can be a valid value.
Use false if null is not a valid value,
here put(Object, Object) and remove(Object) will be optimized.use initialCapacity, final float DEFAULT_INITIAL_CAPACITY for defaultuse loadFactor)DEFAULT_LOAD_FACTOR for default
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static final void | |
| public final void | clear()
Implements java. |
| public final Object | Returns: a shallow copy of this ArrayHashMap, elements are not copied.Overrides java. ArrayHashMap(ArrayHashMap).
|
| public final boolean | containsKey(final Object
key whose presence in this map is to be tested key)Implements java. true if this map contains a mapping for the specified
key.
|
| public boolean | containsValue(final Object
value whose presence in this map is to be tested value)Implements java. true if this map maps one or more keys to the
specified value.
|
| public Set | entrySet()
Implements java. Set view of the mappings contained in this map.
|
| public final boolean | equals(final Object
object to be compared for equality with this map arrayHashMap)Overrides java. Implements java. |
| public final V | get(final Object
the key whose associated value is to be returned key)Implements java. null if this map contains no mapping for the key.
|
| public final ArrayList | |
| public final HashMap | |
| public final int | hashCode()
Overrides java. Implements java. |
| public final boolean | |
| public Set | |
| public final V | put(final K
key with which the specified value is to be associated key, final V value to be associated with the specified key value)Implements java. |
| public void | putAll(final Map<? extends K, ? extends V>
mappings to be stored in this map m)Implements java. |
| public final V | remove(final Object
key whose mapping is to be removed from the map key)Implements java. |
| public final int | |
| public final boolean | |
| public final ArrayList | |
| public final String | |
| public Collection | values()
Implements java. Collection view of the values contained in this map.
|
| data | back to summary |
|---|---|
| private final ArrayList<V> data | |
| DEFAULT_INITIAL_CAPACITY | back to summary |
|---|---|
| public static final int DEFAULT_INITIAL_CAPACITY The default initial capacity: | |
| DEFAULT_LOAD_FACTOR | back to summary |
|---|---|
| public static final float DEFAULT_LOAD_FACTOR Default load factor: | |
| map | back to summary |
|---|---|
| private final HashMap<K, V> map | |
| supportNullValue | back to summary |
|---|---|
| private final boolean supportNullValue | |
| ArrayHashMap | back to summary |
|---|---|
public ArrayHashMap(final boolean supportNullValue, final int initialCapacity, final float loadFactor)
| |
| ArrayHashMap | back to summary |
|---|---|
| public ArrayHashMap(final ArrayHashMap<K, V> o) | |
| checkNullValue | back to summary |
|---|---|
| private static final void checkNullValue(final Object value) throws NullPointerException | |
| clear | back to summary |
|---|---|
| public final 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.
| |
| clone | back to summary |
|---|---|
| public final Object clone() Overrides java. Implementation uses | |
| containsKey | back to summary |
|---|---|
| public final boolean containsKey(final Object key) Implements java. Doc from java. Returns | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(final Object value) Implements java. Doc from java. Returns | |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| equals | back to summary |
|---|---|
| public final boolean equals(final Object arrayHashMap) Overrides java. Implements java. Doc from java. Compares the specified object with this map for equality. Returns
| |
| get | back to summary |
|---|---|
| public final V get(final 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
| |
| getData | back to summary |
|---|---|
| public final ArrayList Returns this object ordered ArrayList. Use w/ care, it's not a copy.
| |
| getMap | back to summary |
|---|---|
| public final HashMap Returns this object hash map. Use w/ care, it's not a copy. | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this map. The hash code of a map is
defined to be the sum of the hash codes of each entry in the map's
| |
| isEmpty | back to summary |
|---|---|
| public final boolean isEmpty() Implements java. Doc from java. Returns
| |
| keySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| put | back to summary |
|---|---|
| public final V put(final K key, final V value) throws NullPointerException 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
This is an O(1) operation, in case the key does not exist, otherwise O(n).
| |
| putAll | back to summary |
|---|---|
| public void putAll(final Map<? extends K, ? extends V> m) 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 final V remove(final 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. This is an O(1) operation, in case the key does not exist, otherwise O(n). | |
| size | back to summary |
|---|---|
| public final int size() Implements java. Doc from java. Returns the number of key-value mappings in this map. If the
map contains more than
| |
| supportsNullValue | back to summary |
|---|---|
| public final boolean supportsNullValue() Returns
Returns
| |
| toArrayList | back to summary |
|---|---|
| public final ArrayList | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| values | back to summary |
|---|---|
| public Collection Implements java. Doc from java. Returns a
See
| |