| java.util.EnumMap
Constructor Summary | |
public | EnumMap(Class<K> keyType) Constructs an empty EnumMap. | public | EnumMap(EnumMap<K, ? extends V> map) Constructs an EnumMap using the same key type and contents as the given
EnumMap. | public | EnumMap(Map<K, ? extends V> map) Constructs an EnumMap with the same contents as the given Map. |
Method Summary | |
public void | clear() Clears this map. | public EnumMap<K, V> | clone() Clones this map to create a shallow copy. | public boolean | containsKey(Object key) Returns true if the given object is present as a key in this map. | public boolean | containsValue(Object value) Returns true if the given object is present as a value in this map. | public Set<Map.Entry<K, V>> | entrySet() Returns a Set of Map.Entry s that represent the entries in
this EnumMap. | public boolean | equals(Object object) Returns true if this EnumMap is equal to the given object. | public V | get(Object key) Returns the value stored in this map for the given key in this map, or null
if this map has no entry for that key.
Parameters: key - the key to get the value for. | public Set<K> | keySet() Returns a Set containing the keys for this EnumMap. | public V | put(K key, V value) Stores a value in this map for the given key. | public void | putAll(Map<? extends K, ? extends V> map) | public V | remove(Object key) Removes the entry for the given key from this map, if there is one. | public int | size() | public Collection<V> | values() Returns a Collection containing the values for this EnumMap. |
enumSize | transient int enumSize(Code) | | |
hasMapping | transient boolean[] hasMapping(Code) | | |
EnumMap | public EnumMap(Class<K> keyType)(Code) | | Constructs an empty EnumMap.
Parameters: keyType - the Class that is to be used for the key type for this map throws: NullPointerException - if the keyType is null |
EnumMap | public EnumMap(EnumMap<K, ? extends V> map)(Code) | | Constructs an EnumMap using the same key type and contents as the given
EnumMap.
Parameters: map - the EnumMap from which the initial contents of this EnumMapare copied throws: NullPointerException - if the map is null |
EnumMap | public EnumMap(Map<K, ? extends V> map)(Code) | | Constructs an EnumMap with the same contents as the given Map. If the Map
is an EnumMap, this is equivalent to calling
EnumMap.EnumMap(EnumMap) }. Otherwise, the given map cannot be
empty so that the key type of this EnumMap can be inferred.
Parameters: map - the Map from which the initial contents of this EnumMap arecopied throws: IllegalArgumentException - if the map is empty and is not of type EnumMap throws: NullPointerException - if the map is null |
clear | public void clear()(Code) | | Clears this map.
|
clone | public EnumMap<K, V> clone()(Code) | | Clones this map to create a shallow copy.
a shallow copy of this map |
containsKey | public boolean containsKey(Object key)(Code) | | Returns true if the given object is present as a key in this map.
Parameters: key - the key to look for true if this map contains the key |
containsValue | public boolean containsValue(Object value)(Code) | | Returns true if the given object is present as a value in this map.
Parameters: value - the value to look for true if this map contains the value. |
entrySet | public Set<Map.Entry<K, V>> entrySet()(Code) | | Returns a Set of Map.Entry s that represent the entries in
this EnumMap. Making changes to this Set will change the original EnumMap
and vice-versa. Entries can be removed from the Set, or their values can
be changed, but new entries cannot be added.
The order of the entries in the Set will be the order that the Enum keys
were declared in.
a Set of Map.Entry s representing the entries inthis EnumMap |
equals | public boolean equals(Object object)(Code) | | Returns true if this EnumMap is equal to the given object.
Parameters: object - the object true if this EnumMap is equal to the given object. |
get | public V get(Object key)(Code) | | Returns the value stored in this map for the given key in this map, or null
if this map has no entry for that key.
Parameters: key - the key to get the value for. the value for the given key. |
keySet | public Set<K> keySet()(Code) | | Returns a Set containing the keys for this EnumMap. Making changes to
this Set will change the original EnumMap and vice-versa. Entries can be
removed from the Set, but new entries cannot be added.
The order of the Set will be the order that the Enum keys were declared
in.
a Set containing the keys for this EnumMap. |
put | public V put(K key, V value)(Code) | | Stores a value in this map for the given key. If the map already has an
entry for this key the current value will be overwritten.
Parameters: key - the key Parameters: value - the value to store for the given key the value stored for the given key, or null if this map has noentry for the key throws: NullPointerException - if the key is null |
putAll | public void putAll(Map<? extends K, ? extends V> map)(Code) | | Add all the entries in the given map to this map
Parameters: map - the map whose entries to copy throws: NullPointerException - if the given map or any of its keys are null |
remove | public V remove(Object key)(Code) | | Removes the entry for the given key from this map, if there is one.
Parameters: key - the key to remove the value that had been stored for the key, or null if there wasnot one. |
size | public int size()(Code) | | Returns the size of this map
the number of entries in the map |
values | public Collection<V> values()(Code) | | Returns a Collection containing the values for this EnumMap. Making
changes to this Collection will change the original EnumMap and
vice-versa. Values can be removed from the Collection, but new entries
cannot be added.
The order of the values in the Collection will be the order that their
corresponding Enum keys were declared in.
a Collection containing the values for this EnumMap |
|
|