java.util.Map implementation that will collect
entries during building, but only materialize full lookup structure
when needed; that is, actual building of hash lookup is deferred.
Inspired by lazily initialized Map used by Boon library.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private Object[] | |
| private Map | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Map | |
| private final int | |
| protected void | |
| public void | clear()
Overrides java. Implements java. Removes all of the mappings from this map (optional operation). |
| protected Object | clone()
Overrides java. Returns a shallow copy of this |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Overrides java. Implements java. Returns |
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Overrides java. Implements java. Returns |
| public Set | entrySet()
Implements abstract java. Implements java. Returns a |
| public boolean | equals(Object
object to be compared for equality with this map other)Overrides java. Implements java. Compares the specified object with this map for equality. |
| public Object | get(Object
the key whose associated value is to be returned key)Overrides java. Implements java. Returns the value to which the specified key is mapped,
or |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this map. |
| public boolean | isEmpty()
Overrides java. Implements java. Returns |
| public Set | keySet()
Overrides java. Implements java. Returns a |
| public Object | put(String
key with which the specified value is to be associated key, Object value to be associated with the specified key value)Overrides java. Implements java. Associates the specified value with the specified key in this map (optional operation). |
| public Object | remove(Object
key whose mapping is to be removed from the map key)Overrides java. Implements java. Removes the mapping for a key from this map if it is present (optional operation). |
| public int | size()
Overrides java. Implements java. Returns the number of key-value mappings in this map. |
| public String | |
| public Collection | values()
Overrides java. Implements java. Returns a |
| _end | back to summary |
|---|---|
| private int _end | |
| _entries | back to summary |
|---|---|
| private Object[] _entries | |
| _map | back to summary |
|---|---|
| private Map<String, Object> _map | |
| _ordered | back to summary |
|---|---|
| private final boolean _ordered | |
| DeferredMap | back to summary |
|---|---|
| public DeferredMap(boolean ordered) | |
| DeferredMap | back to summary |
|---|---|
| public DeferredMap(boolean ordered, int initialSize) | |
| _buildMap | back to summary |
|---|---|
| protected Map | |
| _newSize | back to summary |
|---|---|
| private final int _newSize(int size) | |
| buildIfNeeded | back to summary |
|---|---|
| protected void buildIfNeeded() | |
| clear | back to summary |
|---|---|
| public void clear() Overrides java. 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 |
|---|---|
| protected Object clone() throws CloneNotSupportedException Overrides java. Doc from java. Returns a shallow copy of this
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Overrides java. Implements java. Doc from java. Returns
| |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Overrides java. Implements java. Doc from java. Returns
| |
| entrySet | back to summary |
|---|---|
| public Set Implements abstract java. Implements java. Doc from java. Returns a | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements java. Doc from java. Compares the specified object with this map for equality. Returns
| |
| get | back to summary |
|---|---|
| public Object get(Object key) Overrides java. 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
| |
| hashCode | back to summary |
|---|---|
| public 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 boolean isEmpty() Overrides java. Implements java. Doc from java. Returns
| |
| keySet | back to summary |
|---|---|
| public Set Overrides java. Implements java. Doc from java. Returns a
| |
| put | back to summary |
|---|---|
| public Object put(String key, Object value) Overrides java. 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
| |
| remove | back to summary |
|---|---|
| public Object remove(Object key) Overrides java. 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() Overrides java. Implements java. Doc from java. Returns the number of key-value mappings in this map. If the
map contains more than
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of this map. The string representation
consists of a list of key-value mappings in the order returned by the
map's | |
| values | back to summary |
|---|---|
| public Collection Overrides java. Implements java. Doc from java. Returns a
| |