|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.EnumMap<K,V>
public class EnumMap<K extends Enum<K>,V>
| Field Summary | |
|---|---|
(package private) int |
enumSize
|
(package private) boolean[] |
hasMapping
|
(package private) Enum[] |
keys
|
(package private) Object[] |
values
|
| Fields inherited from class java.util.AbstractMap |
|---|
keySet, valuesCollection |
| Constructor Summary | |
|---|---|
EnumMap(Class<K> keyType)
Constructs an empty enum map using the given key type. |
|
EnumMap(EnumMap<K,? extends V> map)
Constructs an enum map using the same key type as the given enum map and initially containing the same mappings. |
|
EnumMap(Map<K,? extends V> map)
Constructs an enum map initialized from the given map. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all mappings in this map. |
EnumMap<K,V> |
clone()
Returns a shallow copy of this map. |
boolean |
containsKey(Object key)
Returns true if this map has a mapping for the given key. |
boolean |
containsValue(Object value)
Returns true if this map has one or more keys mapped to the given value. |
Set<Map.Entry<K,V>> |
entrySet()
Returns a Set} view of the mappings contained in this map. |
boolean |
equals(Object object)
Compares the given object with this map. |
V |
get(Object key)
Returns the value which is mapped to the given key in this map, or null if this map has no mapping for the given key. |
Set<K> |
keySet()
Returns a Set} view of the keys contained in this map. |
V |
put(K key,
V value)
Associates the given value with the given key in this map. |
void |
putAll(Map<? extends K,? extends V> map)
Copies all the mappings in the given map to this map. |
V |
remove(Object key)
Removes the mapping for this key from this map if it is present. |
int |
size()
Returns the number of the mappings in this map. |
Collection<V> |
values()
Returns a Collection} view of the values contained in this map. |
| Methods inherited from class java.util.AbstractMap |
|---|
hashCode, isEmpty, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
hashCode, isEmpty |
| Field Detail |
|---|
transient Enum[] keys
transient Object[] values
transient boolean[] hasMapping
transient int enumSize
| Constructor Detail |
|---|
public EnumMap(Class<K> keyType)
keyType - the class object of the key type used by this enum map
NullPointerException - if the keyType is nullpublic EnumMap(EnumMap<K,? extends V> map)
map - the enum map from which this enum map is initialized
NullPointerException - if the map is nullpublic EnumMap(Map<K,? extends V> map)
EnumMap(EnumMap)}. Otherwise, the given map at
least should contain one mapping.
map - the map from which this enum map is initialized
IllegalArgumentException - if the map is not an enum map instance and does not contain
any mappings
NullPointerException - if the map is null| Method Detail |
|---|
public void clear()
clear in interface Map<K extends Enum<K>,V>clear in class AbstractMap<K extends Enum<K>,V>AbstractMap.isEmpty(),
AbstractMap.size()public EnumMap<K,V> clone()
clone in class AbstractMap<K extends Enum<K>,V>public boolean containsKey(Object key)
containsKey in interface Map<K extends Enum<K>,V>containsKey in class AbstractMap<K extends Enum<K>,V>key - the key whose presence in this map is to be tested
public boolean containsValue(Object value)
containsValue in interface Map<K extends Enum<K>,V>containsValue in class AbstractMap<K extends Enum<K>,V>value - the value whose presence in this map is to be tested
public Set<Map.Entry<K,V>> entrySet()
Set} view of the mappings contained in this map. The
returned set complies with the general rule specified in
Map.entrySet()}. The set's iterator will return the mappings in
the their keys' natural order(the enum constants are declared in this
order)
entrySet in interface Map<K extends Enum<K>,V>entrySet in class AbstractMap<K extends Enum<K>,V>public boolean equals(Object object)
equals in interface Map<K extends Enum<K>,V>equals in class AbstractMap<K extends Enum<K>,V>object - the object to be compared with this map
AbstractMap.hashCode()public V get(Object key)
get in interface Map<K extends Enum<K>,V>get in class AbstractMap<K extends Enum<K>,V>key - the key whose associated value is to be returned
public Set<K> keySet()
Set} view of the keys contained in this map. The
returned set complies with the general rule specified in
Map.keySet()}. The set's iterator will return the keys in the
their natural order(the enum constants are declared in this order)
keySet in interface Map<K extends Enum<K>,V>keySet in class AbstractMap<K extends Enum<K>,V>
public V put(K key,
V value)
put in interface Map<K extends Enum<K>,V>put in class AbstractMap<K extends Enum<K>,V>key - the key with which the given value is to be associated valuevalue - the value to be associated with the given key
NullPointerException - if the given key is nullpublic void putAll(Map<? extends K,? extends V> map)
putAll in interface Map<K extends Enum<K>,V>putAll in class AbstractMap<K extends Enum<K>,V>map - the key whose presence in this map is to be tested
NullPointerException - if the given map is null, or if one or more keys in the given
map are nullpublic V remove(Object key)
remove in interface Map<K extends Enum<K>,V>remove in class AbstractMap<K extends Enum<K>,V>key - the key whose mapping is to be removed from this map
public int size()
size in interface Map<K extends Enum<K>,V>size in class AbstractMap<K extends Enum<K>,V>public Collection<V> values()
Collection} view of the values contained in this map.
The returned collection complys with the general rule specified in
Map.values()}. The collection's iterator will return the values
in the their corresponding keys' natural order(the enum constants are
declared in this order)
values in interface Map<K extends Enum<K>,V>values in class AbstractMap<K extends Enum<K>,V>
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||