fixed some formatting typos
[vimdoclet.git] / sample / java.util.Map.Entry.txt
blobd1831963382fe8b894382bee0762dd32f0a8c2d7
1 *java.util.Map.Entry* *Map.Entry* A map entry (key-value pair).
3 public static interface interface Map.Entry<K,V>
6 |java.util.Map.Entry_Description|
7 |java.util.Map.Entry_Fields|
8 |java.util.Map.Entry_Constructors|
9 |java.util.Map.Entry_Methods|
11 ================================================================================
13 *java.util.Map.Entry_Methods*
14 |java.util.Map.Entry.equals(Object)|Compares the specified object with this ent
15 |java.util.Map.Entry.getKey()|Returns the key corresponding to this entry.
16 |java.util.Map.Entry.getValue()|Returns the value corresponding to this entry.
17 |java.util.Map.Entry.hashCode()|Returns the hash code value for this map entry.
18 |java.util.Map.Entry.setValue(V)|Replaces the value corresponding to this entry
20 *java.util.Map.Entry_Description*
22 A map entry (key-value pair). The Map.entrySet method returns a collection-view 
23 of the map, whose elements are of this class. The only way to obtain a 
24 reference to a map entry is from the iterator of this collection-view. These 
25 Map.Entry objects are valid only for the duration of the iteration; more 
26 formally, the behavior of a map entry is undefined if the backing map has been 
27 modified after the entry was returned by the iterator, except through the 
28 setValue operation on the map entry. 
32 *java.util.Map.Entry.equals(Object)*
34 public boolean equals(java.lang.Object o)
36 Compares the specified object with this entry for equality. Returns true if the 
37 given object is also a map entry and the two entries represent the same 
38 mapping. More formally, two entries e1 and e2 represent the same mapping if 
40 (e1.getKey()==null ? e2.getKey()==null : e1.getKey().equals(e2.getKey())) and 
41 and (e1.getValue()==null ? e2.getValue()==null : 
42 e1.getValue().equals(e2.getValue())) 
44 This ensures that the equals method works properly across different 
45 implementations of the Map.Entry interface. 
48     o - object to be compared for equality with this map entry 
50     Returns: true if the specified object is equal to this map entry 
52 *java.util.Map.Entry.getKey()*
54 public |K| getKey()
56 Returns the key corresponding to this entry. 
60     Returns: the key corresponding to this entry 
62 *java.util.Map.Entry.getValue()*
64 public |V| getValue()
66 Returns the value corresponding to this entry. If the mapping has been removed 
67 from the backing map (by the iterator's remove operation), the results of this 
68 call are undefined. 
72     Returns: the value corresponding to this entry 
74 *java.util.Map.Entry.hashCode()*
76 public int hashCode()
78 Returns the hash code value for this map entry. The hash code of a map entry e 
79 is defined to be: 
81 (e.getKey()==null ? 0 : e.getKey().hashCode()) ^ (e.getValue()==null ? 0 : 
82 e.getValue().hashCode()) 
84 This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for 
85 any two Entries e1 and e2, as required by the general contract of 
86 Object.hashCode. 
90     Returns: the hash code value for this map entry 
92 *java.util.Map.Entry.setValue(V)*
94 public |V| setValue(V value)
96 Replaces the value corresponding to this entry with the specified value 
97 (optional operation). (Writes through to the map.) The behavior of this call is 
98 undefined if the mapping has already been removed from the map (by the 
99 iterator's remove operation). 
102     value - new value to be stored in this entry 
104     Returns: old value corresponding to the entry