APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.util

pack-priv Class ReverseOrderSortedMapView<K, V>

extends AbstractMap<K, V>
implements SortedMap<K, V>
Class Inheritance
All Implemented Interfaces
java.util.SortedMap, java.util.SequencedMap, java.util.Map

Provides a reversed-ordered view of a SortedMap. Not serializable.

Todo

copy in equals and hashCode from AbstractMap

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
ReverseOrderSortedMapView.Submap

Used for various submap views.

pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final SortedMap<K, V>
pack-priv final Comparator<? super K>
Inherited from java.util.AbstractMap:
keySetvalues

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides java.util.AbstractMap.clear.

Implements java.util.Map.clear.

Removes all of the mappings from this map (optional operation).

public Comparator<? super K>
comparator()

Implements java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

public boolean
containsKey(Object key)

Overrides java.util.AbstractMap.containsKey.

Implements java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public boolean
containsValue(Object value)

Overrides java.util.AbstractMap.containsValue.

Implements java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.

pack-priv static <K, V> Iterator<Map.Entry<K, V>>
pack-priv static <K, V> Iterator<K>
pack-priv static <K, V> Iterator<V>
public Set<Map.Entry<K, V>>
entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.SortedMap.entrySet, java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public Map.Entry<K, V>
firstEntry()

Overrides default java.util.SequencedMap.firstEntry.

Returns the first key-value mapping in this map, or null if the map is empty.

public K
firstKey()

Implements java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

public V
get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

public SortedMap<K, V>
headMap(K toKey)

Implements java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey.

public boolean
isEmpty()

Overrides java.util.AbstractMap.isEmpty.

Implements java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.

public Set<K>
keySet()

Overrides java.util.AbstractMap.keySet.

Implements java.util.SortedMap.keySet, java.util.Map.keySet.

Returns a Set view of the keys contained in this map.

public Map.Entry<K, V>
lastEntry()

Overrides default java.util.SequencedMap.lastEntry.

Returns the last key-value mapping in this map, or null if the map is empty.

public K
lastKey()

Implements java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

public static <K, V> SortedMap<K, V>
of(SortedMap<K, V> map)

public Map.Entry<K, V>
pollFirstEntry()

Overrides default java.util.SequencedMap.pollFirstEntry.

Removes and returns the first key-value mapping in this map, or null if the map is empty (optional operation).

public Map.Entry<K, V>
pollLastEntry()

Overrides default java.util.SequencedMap.pollLastEntry.

Removes and returns the last key-value mapping in this map, or null if the map is empty (optional operation).

public V
put(K key, V value)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).

public void
putAll(Map<? extends K, ? extends V> m)

Overrides java.util.AbstractMap.putAll.

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation).

public V
putFirst(K k, V v)

Overrides default java.util.SortedMap.putFirst.

Throws UnsupportedOperationException.

public V
putLast(K k, V v)

Overrides default java.util.SortedMap.putLast.

Throws UnsupportedOperationException.

public V
remove(Object key)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).

public SortedMap<K, V>
reversed()

Overrides default java.util.SortedMap.reversed.

Returns a reverse-ordered view of this map.

public int
size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.

public SortedMap<K, V>
subMap(K fromKey, K toKey)

Implements java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.

public SortedMap<K, V>
tailMap(K fromKey)

Implements java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey.

public String
toString()

Overrides java.util.AbstractMap.toString.

Returns a string representation of this map.

pack-priv static <K, V> String
toString(Map<K, V> thisMap, Iterator<Map.Entry<K, V>> i)

public Collection<V>
values()

Overrides java.util.AbstractMap.values.

Implements java.util.SortedMap.values, java.util.Map.values.

Returns a Collection view of the values contained in this map.

Inherited from java.util.AbstractMap:
cloneequalshashCode

Field Detail

baseback to summary
pack-priv final SortedMap<K, V> base
cmpback to summary
pack-priv final Comparator<? super K> cmp

Constructor Detail

ReverseOrderSortedMapViewback to summary
private ReverseOrderSortedMapView(SortedMap<K, V> map)

Method Detail

clearback to summary
public void clear()

Overrides java.util.AbstractMap.clear.

Implements java.util.Map.clear.

Doc from java.util.Map.clear.

Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.

comparatorback to summary
public Comparator<? super K> comparator()

Implements java.util.SortedMap.comparator.

Doc from java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

containsKeyback to summary
public boolean containsKey(Object key)

Overrides java.util.AbstractMap.containsKey.

Implements java.util.Map.containsKey.

Doc from java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that Objects.equals(key, k). (There can be at most one such mapping.)

containsValueback to summary
public boolean containsValue(Object value)

Overrides java.util.AbstractMap.containsValue.

Implements java.util.Map.containsValue.

Doc from java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value. More formally, returns true if and only if this map contains at least one mapping to a value v such that Objects.equals(value, v). This operation will probably require time linear in the map size for most implementations of the Map interface.

descendingEntryIteratorback to summary
pack-priv static <K, V> Iterator<Map.Entry<K, V>> descendingEntryIterator(SortedMap<K, V> map)
descendingKeyIteratorback to summary
pack-priv static <K, V> Iterator<K> descendingKeyIterator(SortedMap<K, V> map)
descendingValueIteratorback to summary
pack-priv static <K, V> Iterator<V> descendingValueIterator(SortedMap<K, V> map)
entrySetback to summary
public Set<Map.Entry<K, V>> entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.SortedMap.entrySet, java.util.Map.entrySet.

Doc from java.util.SortedMap.entrySet.

Returns a Set view of the mappings contained in this map. The set's iterator returns the entries in ascending key order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

firstEntryback to summary
public Map.Entry<K, V> firstEntry()

Overrides default java.util.SequencedMap.firstEntry.

Doc from java.util.SequencedMap.firstEntry.

Returns the first key-value mapping in this map, or null if the map is empty.

firstKeyback to summary
public K firstKey()

Implements java.util.SortedMap.firstKey.

Doc from java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

getback to summary
public V get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Doc from java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then 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.

headMapback to summary
public SortedMap<K, V> headMap(K toKey)

Implements java.util.SortedMap.headMap.

Doc from java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

isEmptyback to summary
public boolean isEmpty()

Overrides java.util.AbstractMap.isEmpty.

Implements java.util.Map.isEmpty.

Doc from java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.

keySetback to summary
public Set<K> keySet()

Overrides java.util.AbstractMap.keySet.

Implements java.util.SortedMap.keySet, java.util.Map.keySet.

Doc from java.util.SortedMap.keySet.

Returns a Set view of the keys contained in this map. The set's iterator returns the keys in ascending order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

lastEntryback to summary
public Map.Entry<K, V> lastEntry()

Overrides default java.util.SequencedMap.lastEntry.

Doc from java.util.SequencedMap.lastEntry.

Returns the last key-value mapping in this map, or null if the map is empty.

lastKeyback to summary
public K lastKey()

Implements java.util.SortedMap.lastKey.

Doc from java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

ofback to summary
public static <K, V> SortedMap<K, V> of(SortedMap<K, V> map)
pollFirstEntryback to summary
public Map.Entry<K, V> pollFirstEntry()

Overrides default java.util.SequencedMap.pollFirstEntry.

Doc from java.util.SequencedMap.pollFirstEntry.

Removes and returns the first key-value mapping in this map, or null if the map is empty (optional operation).

pollLastEntryback to summary
public Map.Entry<K, V> pollLastEntry()

Overrides default java.util.SequencedMap.pollLastEntry.

Doc from java.util.SequencedMap.pollLastEntry.

Removes and returns the last key-value mapping in this map, or null if the map is empty (optional operation).

putback to summary
public V put(K key, V value)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Doc from java.util.Map.put.

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 m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

putAllback to summary
public void putAll(Map<? extends K, ? extends V> m)

Overrides java.util.AbstractMap.putAll.

Implements java.util.Map.putAll.

Doc from java.util.Map.putAll.

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 put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress. If the specified map has a defined encounter order, processing of its mappings generally occurs in that order.

putFirstback to summary
public V putFirst(K k, V v)

Overrides default java.util.SortedMap.putFirst.

Doc from java.util.SortedMap.putFirst.

Throws UnsupportedOperationException. The encounter order induced by this map's comparison method determines the position of mappings, so explicit positioning is not supported.

putLastback to summary
public V putLast(K k, V v)

Overrides default java.util.SortedMap.putLast.

Doc from java.util.SortedMap.putLast.

Throws UnsupportedOperationException. The encounter order induced by this map's comparison method determines the position of mappings, so explicit positioning is not supported.

removeback to summary
public V remove(Object key)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Doc from java.util.Map.remove.

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 k to value v such that Objects.equals(key, k), that mapping is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

The map will not contain a mapping for the specified key once the call returns.

reversedback to summary
public SortedMap<K, V> reversed()

Overrides default java.util.SortedMap.reversed.

Doc from java.util.SortedMap.reversed.

Returns a reverse-ordered view of this map. The encounter order of mappings in the returned view is the inverse of the encounter order of mappings in this map. The reverse ordering affects all order-sensitive operations, including those on the view collections of the returned view. If the implementation permits modifications to this view, the modifications "write through" to the underlying map. Changes to the underlying map might or might not be visible in this reversed view, depending upon the implementation.

sizeback to summary
public int size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Doc from java.util.Map.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

subMapback to summary
public SortedMap<K, V> subMap(K fromKey, K toKey)

Implements java.util.SortedMap.subMap.

Doc from java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. (If fromKey and toKey are equal, the returned map is empty.) The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

tailMapback to summary
public SortedMap<K, V> tailMap(K fromKey)

Implements java.util.SortedMap.tailMap.

Doc from java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

toStringback to summary
public String toString()

Overrides java.util.AbstractMap.toString.

Doc from java.util.AbstractMap.toString.

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 entrySet view's iterator, enclosed in braces ("{}"). Adjacent mappings are separated by the characters ", " (comma and space). Each key-value mapping is rendered as the key followed by an equals sign ("=") followed by the associated value. Keys and values are converted to strings as by String#valueOf(Object).

toStringback to summary
pack-priv static <K, V> String toString(Map<K, V> thisMap, Iterator<Map.Entry<K, V>> i)
valuesback to summary
public Collection<V> values()

Overrides java.util.AbstractMap.values.

Implements java.util.SortedMap.values, java.util.Map.values.

Doc from java.util.SortedMap.values.

Returns a Collection view of the values contained in this map. The collection's iterator returns the values in ascending order of the corresponding keys. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

java.util back to summary

pack-priv Class ReverseOrderSortedMapView.Submap

extends AbstractMap<K, V>
implements SortedMap<K, V>
Class Inheritance
All Implemented Interfaces
java.util.SortedMap, java.util.SequencedMap, java.util.Map

Used for various submap views. We can't use the base SortedMap's subMap, because of the asymmetry between from-inclusive and to-exclusive.

Field Summary

Modifier and TypeField and Description
pack-priv final K
pack-priv final K
Inherited from java.util.AbstractMap:
keySetvalues

Constructor Summary

AccessConstructor and Description
pack-priv
Submap(K head, K tail)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
aboveHead(K k)

pack-priv boolean
belowTail(K k)

public Comparator<? super K>
comparator()

Implements java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

pack-priv Iterator<Map.Entry<K, V>>
public Set<Map.Entry<K, V>>
entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.SortedMap.entrySet, java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public K
firstKey()

Implements java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

public SortedMap<K, V>
headMap(K to)

Implements java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey.

public K
lastKey()

Implements java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

public V
put(K key, V value)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).

public V
remove(Object o)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).

public int
size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.

public SortedMap<K, V>
subMap(K from, K to)

Implements java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.

public SortedMap<K, V>
tailMap(K from)

Implements java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey.

public String
toString()

Overrides java.util.AbstractMap.toString.

Returns a string representation of this map.

Inherited from java.util.AbstractMap:
clearclonecontainsKeycontainsValueequalsgethashCodeisEmptykeySetputAllvalues

Field Detail

headback to summary
pack-priv final K head
tailback to summary
pack-priv final K tail

Constructor Detail

Submapback to summary
pack-priv Submap(K head, K tail)

Method Detail

aboveHeadback to summary
pack-priv boolean aboveHead(K k)
belowTailback to summary
pack-priv boolean belowTail(K k)
comparatorback to summary
public Comparator<? super K> comparator()

Implements java.util.SortedMap.comparator.

Doc from java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

entryIteratorback to summary
pack-priv Iterator<Map.Entry<K, V>> entryIterator()
entrySetback to summary
public Set<Map.Entry<K, V>> entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.SortedMap.entrySet, java.util.Map.entrySet.

Doc from java.util.SortedMap.entrySet.

Returns a Set view of the mappings contained in this map. The set's iterator returns the entries in ascending key order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

firstKeyback to summary
public K firstKey()

Implements java.util.SortedMap.firstKey.

Doc from java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

headMapback to summary
public SortedMap<K, V> headMap(K to)

Implements java.util.SortedMap.headMap.

Doc from java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

lastKeyback to summary
public K lastKey()

Implements java.util.SortedMap.lastKey.

Doc from java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

putback to summary
public V put(K key, V value)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Doc from java.util.Map.put.

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 m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

removeback to summary
public V remove(Object o)

Overrides java.util.AbstractMap.remove.

Implements java.util.Map.remove.

Doc from java.util.Map.remove.

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 k to value v such that Objects.equals(key, k), that mapping is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

The map will not contain a mapping for the specified key once the call returns.

sizeback to summary
public int size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Doc from java.util.Map.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

subMapback to summary
public SortedMap<K, V> subMap(K from, K to)

Implements java.util.SortedMap.subMap.

Doc from java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. (If fromKey and toKey are equal, the returned map is empty.) The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

tailMapback to summary
public SortedMap<K, V> tailMap(K from)

Implements java.util.SortedMap.tailMap.

Doc from java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

toStringback to summary
public String toString()

Overrides java.util.AbstractMap.toString.

Doc from java.util.AbstractMap.toString.

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 entrySet view's iterator, enclosed in braces ("{}"). Adjacent mappings are separated by the characters ", " (comma and space). Each key-value mapping is rendered as the key followed by an equals sign ("=") followed by the associated value. Keys and values are converted to strings as by String#valueOf(Object).

java.util back to summary

pack-priv Class ReverseOrderSortedMapView.ViewEntry<K, V>

extends Object
implements Map.Entry<K, V>
Class Inheritance
All Implemented Interfaces
java.util.Map.Entry

Field Summary

Modifier and TypeField and Description
pack-priv final K
pack-priv final Map<K, V>
pack-priv final V

Constructor Summary

AccessConstructor and Description
pack-priv
ViewEntry(Map<K, V> map, K key, V value)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Implements java.util.Map.Entry.equals.

Compares the specified object with this entry for equality.

public K
getKey()

Implements java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

public V
getValue()

Implements java.util.Map.Entry.getValue.

Returns the value corresponding to this entry.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry.

public V
setValue(V newValue)

Implements java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

keyback to summary
pack-priv final K key
mapback to summary
pack-priv final Map<K, V> map
valueback to summary
pack-priv final V value

Constructor Detail

ViewEntryback to summary
pack-priv ViewEntry(Map<K, V> map, K key, V value)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements java.util.Map.Entry.equals.

Doc from java.util.Map.Entry.equals.

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.
getKeyback to summary
public K getKey()

Implements java.util.Map.Entry.getKey.

Doc from java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

getValueback to summary
public V getValue()

Implements java.util.Map.Entry.getValue.

Doc from java.util.Map.Entry.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.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Doc from java.util.Map.Entry.hashCode.

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.
setValueback to summary
public V setValue(V newValue)

Implements java.util.Map.Entry.setValue.

Doc from java.util.Map.Entry.setValue.

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).

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.