1 *java.util.AbstractMap.SimpleEntry* *AbstractMap.SimpleEntry* An Entry maintaini
3 public static class AbstractMap.SimpleEntry<K,V>
4 extends |java.lang.Object|
5 implements |java.util.Map.Entry|
8 |java.util.AbstractMap.SimpleEntry_Description|
9 |java.util.AbstractMap.SimpleEntry_Fields|
10 |java.util.AbstractMap.SimpleEntry_Constructors|
11 |java.util.AbstractMap.SimpleEntry_Methods|
13 ================================================================================
15 *java.util.AbstractMap.SimpleEntry_Constructors*
16 |java.util.AbstractMap.SimpleEntry(K,V)|Creates an entry representing a mapping
17 |java.util.AbstractMap.SimpleEntry(Map.Entry<?extendsK,?extendsV>)|Creates an e
19 *java.util.AbstractMap.SimpleEntry_Methods*
20 |java.util.AbstractMap.SimpleEntry.equals(Object)|Compares the specified object
21 |java.util.AbstractMap.SimpleEntry.getKey()|Returns the key corresponding to th
22 |java.util.AbstractMap.SimpleEntry.getValue()|Returns the value corresponding t
23 |java.util.AbstractMap.SimpleEntry.hashCode()|Returns the hash code value for t
24 |java.util.AbstractMap.SimpleEntry.setValue(V)|Replaces the value corresponding
25 |java.util.AbstractMap.SimpleEntry.toString()|Returns a String representation o
27 *java.util.AbstractMap.SimpleEntry_Description*
29 An Entry maintaining a key and a value. The value may be changed using the
30 setValue method. This class facilitates the process of building custom map
31 implementations. For example, it may be convenient to return arrays of
32 SimpleEntry instances in method Map.entrySet().toArray.
36 *java.util.AbstractMap.SimpleEntry(K,V)*
38 public AbstractMap.SimpleEntry(
42 Creates an entry representing a mapping from the specified key to the specified
45 key - the key represented by this entry
46 value - the value represented by this entry
48 *java.util.AbstractMap.SimpleEntry(Map.Entry<?extendsK,?extendsV>)*
50 public AbstractMap.SimpleEntry(java.util.Map.Entry<? extends K, ? extends V> entry)
52 Creates an entry representing the same mapping as the specified entry.
54 entry - the entry to copy
56 *java.util.AbstractMap.SimpleEntry.equals(Object)*
58 public boolean equals(java.lang.Object o)
60 Compares the specified object with this entry for equality. Returnstrueif the
61 given object is also a map entry and the two entries represent the same
62 mapping. More formally, two entriese1ande2represent the same mapping if
64 (e1.getKey()==null ? e2.getKey()==null : e1.getKey().equals(e2.getKey())) and
65 and (e1.getValue()==null ? e2.getValue()==null :
66 e1.getValue().equals(e2.getValue()))
68 This ensures that theequalsmethod works properly across different
69 implementations of theMap.Entryinterface.
72 o - object to be compared for equality with this map entry
74 Returns: {@code true} if the specified object is equal to this map entry
76 *java.util.AbstractMap.SimpleEntry.getKey()*
80 Returns the key corresponding to this entry.
84 Returns: the key corresponding to this entry
86 *java.util.AbstractMap.SimpleEntry.getValue()*
90 Returns the value corresponding to this entry.
94 Returns: the value corresponding to this entry
96 *java.util.AbstractMap.SimpleEntry.hashCode()*
100 Returns the hash code value for this map entry. The hash code of a map entryeis
103 (e.getKey()==null ? 0 : e.getKey().hashCode()) ^ (e.getValue()==null ? 0 :
104 e.getValue().hashCode())
106 This ensures thate1.equals(e2)implies thate1.hashCode()==e2.hashCode()for any
107 two Entriese1ande2, as required by the general contract of (|java.lang.Object|)
112 Returns: the hash code value for this map entry
114 *java.util.AbstractMap.SimpleEntry.setValue(V)*
116 public |V| setValue(V value)
118 Replaces the value corresponding to this entry with the specified value.
121 value - new value to be stored in this entry
123 Returns: the old value corresponding to the entry
125 *java.util.AbstractMap.SimpleEntry.toString()*
127 public |java.lang.String| toString()
129 Returns a String representation of this map entry. This implementation returns
130 the string representation of this entry's key followed by the equals character
131 ("=") followed by the string representation of this entry's value.
135 Returns: a String representation of this map entry