1 *java.util.AbstractMap.SimpleImmutableEntry* *AbstractMap.SimpleImmutableEntry*
3 public static class AbstractMap.SimpleImmutableEntry<K,V>
4 extends |java.lang.Object|
5 implements |java.util.Map.Entry|
8 |java.util.AbstractMap.SimpleImmutableEntry_Description|
9 |java.util.AbstractMap.SimpleImmutableEntry_Fields|
10 |java.util.AbstractMap.SimpleImmutableEntry_Constructors|
11 |java.util.AbstractMap.SimpleImmutableEntry_Methods|
13 ================================================================================
15 *java.util.AbstractMap.SimpleImmutableEntry_Constructors*
16 |java.util.AbstractMap.SimpleImmutableEntry(K,V)|Creates an entry representing
17 |java.util.AbstractMap.SimpleImmutableEntry(Map.Entry<?extendsK,?extendsV>)|Cre
19 *java.util.AbstractMap.SimpleImmutableEntry_Methods*
20 |java.util.AbstractMap.SimpleImmutableEntry.equals(Object)|Compares the specifi
21 |java.util.AbstractMap.SimpleImmutableEntry.getKey()|Returns the key correspond
22 |java.util.AbstractMap.SimpleImmutableEntry.getValue()|Returns the value corres
23 |java.util.AbstractMap.SimpleImmutableEntry.hashCode()|Returns the hash code va
24 |java.util.AbstractMap.SimpleImmutableEntry.setValue(V)|Replaces the value corr
25 |java.util.AbstractMap.SimpleImmutableEntry.toString()|Returns a String represe
27 *java.util.AbstractMap.SimpleImmutableEntry_Description*
29 An Entry maintaining an immutable key and value. This class does not support
30 method setValue. This class may be convenient in methods that return
31 thread-safe snapshots of key-value mappings.
35 *java.util.AbstractMap.SimpleImmutableEntry(K,V)*
37 public AbstractMap.SimpleImmutableEntry(
41 Creates an entry representing a mapping from the specified key to the specified
44 key - the key represented by this entry
45 value - the value represented by this entry
47 *java.util.AbstractMap.SimpleImmutableEntry(Map.Entry<?extendsK,?extendsV>)*
49 public AbstractMap.SimpleImmutableEntry(java.util.Map.Entry<? extends K, ? extends V> entry)
51 Creates an entry representing the same mapping as the specified entry.
53 entry - the entry to copy
55 *java.util.AbstractMap.SimpleImmutableEntry.equals(Object)*
57 public boolean equals(java.lang.Object o)
59 Compares the specified object with this entry for equality. Returnstrueif the
60 given object is also a map entry and the two entries represent the same
61 mapping. More formally, two entriese1ande2represent the same mapping if
63 (e1.getKey()==null ? e2.getKey()==null : e1.getKey().equals(e2.getKey())) and
64 and (e1.getValue()==null ? e2.getValue()==null :
65 e1.getValue().equals(e2.getValue()))
67 This ensures that theequalsmethod works properly across different
68 implementations of theMap.Entryinterface.
71 o - object to be compared for equality with this map entry
73 Returns: {@code true} if the specified object is equal to this map entry
75 *java.util.AbstractMap.SimpleImmutableEntry.getKey()*
79 Returns the key corresponding to this entry.
83 Returns: the key corresponding to this entry
85 *java.util.AbstractMap.SimpleImmutableEntry.getValue()*
89 Returns the value corresponding to this entry.
93 Returns: the value corresponding to this entry
95 *java.util.AbstractMap.SimpleImmutableEntry.hashCode()*
99 Returns the hash code value for this map entry. The hash code of a map entryeis
102 (e.getKey()==null ? 0 : e.getKey().hashCode()) ^ (e.getValue()==null ? 0 :
103 e.getValue().hashCode())
105 This ensures thate1.equals(e2)implies thate1.hashCode()==e2.hashCode()for any
106 two Entriese1ande2, as required by the general contract of (|java.lang.Object|)
111 Returns: the hash code value for this map entry
113 *java.util.AbstractMap.SimpleImmutableEntry.setValue(V)*
115 public |V| setValue(V value)
117 Replaces the value corresponding to this entry with the specified value
118 (optional operation). This implementation simply throws
119 UnsupportedOperationException, as this class implements an immutable map entry.
122 value - new value to be stored in this entry
124 Returns: (Does not return)
126 *java.util.AbstractMap.SimpleImmutableEntry.toString()*
128 public |java.lang.String| toString()
130 Returns a String representation of this map entry. This implementation returns
131 the string representation of this entry's key followed by the equals character
132 ("=") followed by the string representation of this entry's value.
136 Returns: a String representation of this map entry