GenericMap is simply an abstract java.util.Map
implementation for which subclasses really only need to implement
the method entryIterator.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract class | |
| pack-priv class | |
| pack-priv abstract class | |
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| protected int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| 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. return the element with the given key |
| protected abstract Iterator | |
| public Set | entrySet()
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 int | hashCode()
Overrides java. Implements java. Returns the hash code value for this map. |
| public boolean | |
| protected boolean | |
| protected int | |
| protected Iterator | |
| public Set | |
| public void | putAll(Map<K, V>
mappings to be stored in this map other)Implements java. Copies all of the mappings from the specified map to this map (optional operation). |
| public int | |
| private static Object[] | |
| protected boolean | |
| protected int | |
| protected Iterator | |
| public Collection | values()
Implements java. Returns a |
| size | back to summary |
|---|---|
| protected int size | |
| GenericMap | back to summary |
|---|---|
| public GenericMap() | |
| 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. return the element with the given key
| |
| entryIterator | back to summary |
|---|---|
| protected abstract Iterator | |
| entrySet | back to summary |
|---|---|
| public Set 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
| |
| 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() Implements java. Doc from java. Returns
| |
| keyEquals | back to summary |
|---|---|
| protected boolean keyEquals(Object containedKey, Object givenKey) | |
| keyHash | back to summary |
|---|---|
| protected int keyHash(Object key) | |
| keyIterator | back to summary |
|---|---|
| protected Iterator | |
| keySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a
| |
| putAll | back to summary |
|---|---|
| public void putAll(Map<K, V> other) 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
| |
| 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
| |
| toArray | back to summary |
|---|---|
| private static Object[] toArray(Object[] arr, int size, Iterator<E> it) I don't quite understand why we need to replace this method from AbstractCollection, but it has been observed that toArray returns the *reverse* order of elements. --Kresten | |
| valueEquals | back to summary |
|---|---|
| protected boolean valueEquals(Object value1, Object value2) | |
| valueHash | back to summary |
|---|---|
| protected int valueHash(Object value) | |
| valueIterator | back to summary |
|---|---|
| protected Iterator | |
| values | back to summary |
|---|---|
| public Collection Implements java. Doc from java. Returns a
| |
| 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 other)Overrides java. Implements java. Compares the specified object with this entry for equality. |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this map entry. |
| Entry | back to summary |
|---|---|
| pack-priv Entry() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) 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.
| |
| 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.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Object |
| KeyIterator | back to summary |
|---|---|
| pack-priv KeyIterator() | |
| next | back to summary |
|---|---|
| public Object next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| protected Map. | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| iter | back to summary |
|---|---|
| pack-priv final Iterator<E> iter | |
| KeyOrValueIterator | back to summary |
|---|---|
| pack-priv KeyOrValueIterator() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| nextEntry | back to summary |
|---|---|
| protected Map. | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Object |
| ValueIterator | back to summary |
|---|---|
| pack-priv ValueIterator() | |
| next | back to summary |
|---|---|
| public Object next() Implements java. Doc from java. Returns the next element in the iteration.
| |