Java Reference
In-Depth Information
47
/**
48
* Removes all key/value pairs from the map.
49
*/
50
void clear( );
51
52
/**
53
* Returns the keys in the map.
54
*/
55
Set<KeyType> keySet( );
56
57
/**
58
* Returns the values in the map. There may be duplicates.
59
*/
60
Collection<ValueType> values( );
61
62
/**
63
* Return a set of Map.Entry objects corresponding to
64
* the key/value pairs in the map.
65
*/
66
Set<Entry<KeyType,ValueType>> entrySet( );
67
68
/**
69
* Interface used to access the key/value pairs in a map.
70
* From a map, use entrySet().iterator to obtain an iterator
71
* over a Set of pairs. The next() method of this iterator
72
* yields objects of type Map.Entry<KeyType,ValueType>.
73
*/
74
public interface Entry<KeyType,ValueType> extends java.io.Serializable
75
{
76
/**
77
* Returns this pair's key.
78
*/
79
KeyType getKey( );
80
81
/**
82
* Returns this pair's value.
83
*/
84
ValueType getValue( );
85
86
/**
87
* Change this pair's value.
88
* @return the old value associated with this pair.
89
*/
90
ValueType setValue( ValueType newValue );
91
}
92
}
figure 6.37
A sample
Map
interface (part 2)
Search WWH ::
Custom Search