| java.util.Map<K, V> |
Known Indirect Subclasses
AbstractMap<K, V>,
Attributes,
AuthProvider,
ConcurrentHashMap<K, V>,
ConcurrentMap<K, V>,
EnumMap<K extends Enum<K>, V>,
HashMap<K, V>,
Hashtable<K, V>,
IdentityHashMap<K, V>,
LinkedHashMap<K, V>,
Properties,
Provider,
SortedMap<K, V>,
TreeMap<K, V>,
WeakHashMap<K, V>
|
Map has a set of keys, each key is mapped to a single value.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Map.Entry<K, V> | Map.Entry is a key/value mapping which is contained in a Map. | ||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Removes all elements from this Map, leaving it empty.
| |||||||||||
Searches this Map for the specified key.
| |||||||||||
Searches this Map for the specified value.
| |||||||||||
Returns a
Set whose elements comprise all of the mappings
that are to be found in this Map. | |||||||||||
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
| |||||||||||
Returns the value of the mapping with the specified key.
| |||||||||||
Returns an integer hash code for the receiver.
| |||||||||||
Returns if this Map has no elements, a size of zero.
| |||||||||||
Returns a Set of the keys contained in this Map.
| |||||||||||
Maps the specified key to the specified value.
| |||||||||||
Copies every mapping in the specified Map to this Map.
| |||||||||||
Removes a mapping with the specified key from this Map.
| |||||||||||
Returns the number of elements in this Map.
| |||||||||||
Returns all of the current
Map values in a
Collection. | |||||||||||
Removes all elements from this Map, leaving it empty.
| UnsupportedOperationException | when removing from this Map is not supported |
|---|
Searches this Map for the specified key.
| key | the object to search for |
|---|
key is a key of this Map, false otherwise
Searches this Map for the specified value.
| value | the object to search for |
|---|
value is a value of this Map, false
otherwise
Returns a Set whose elements comprise all of the mappings
that are to be found in this Map. Information on each of
the mappings is encapsulated in a separate Map.Entry instance. As
the Set is backed by this Map, users
should be aware that changes in one will be immediately visible in the
other.
Set of the mappings
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
| object | Object the object to compare with this object. |
|---|
true if the object is the same as this
object false if it is different from this object.Returns the value of the mapping with the specified key.
| key | the key |
|---|
Returns an integer hash code for the receiver. Objects which are equal answer the same value for this method.
Returns if this Map has no elements, a size of zero.
Returns a Set of the keys contained in this Map. The set is backed by this Map so changes to one are relected by the other. The set does not support adding.
Maps the specified key to the specified value.
| key | the key |
|---|---|
| value | the value |
| UnsupportedOperationException | when adding to this Map is not supported |
|---|---|
| ClassCastException | when the class of the key or value is inappropriate for this Map |
| IllegalArgumentException | when the key or value cannot be added to this Map |
| NullPointerException | when the key or value is null and this Map does not support null keys or values |
Copies every mapping in the specified Map to this Map.
| map | the Map to copy mappings from |
|---|
| UnsupportedOperationException | when adding to this Map is not supported |
|---|---|
| ClassCastException | when the class of a key or value is inappropriate for this Map |
| IllegalArgumentException | when a key or value cannot be added to this Map |
| NullPointerException | when a key or value is null and this Map does not support null keys or values |
Removes a mapping with the specified key from this Map.
| key | the key of the mapping to remove |
|---|
| UnsupportedOperationException | when removing from this Map is not supported |
|---|
Returns the number of elements in this Map.
Returns all of the current Map values in a
Collection. As the returned Collection is
backed by this Map, users should be aware that changes in
one will be immediately visible in the other.