public interface Map
(J2SE)
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all mappings from this map.
|
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified
key.
|
Object |
get(Object key)
Returns the value to which this map maps the specified
key.
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
Set |
keySet()
Returns a set view of the keys contained in this map.
|
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map
(optional operation).
|
Object |
remove(Object key)
Removes the mapping for this key from this map if present (optional
operation).
|
int |
size()
Returns the number of mappings in this map.
|
Collection |
values()
Returns a Collection view of the values contained in this map.
|
boolean isEmpty()
Map
Object remove(Object key)
key
- key whose mapping is to be removed from the map.Map
Set keySet()
Map
Collection values()
Map
Object put(Object key, Object value)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.Map
boolean containsKey(Object key)
key
- key whose presence in this map is to be tested.Map
Object get(Object key)
key
- key whose associated value is to be returned.Map
int size()
Map
void clear()
Map