| java.lang.Object | ||
| ↳ | java.util.AbstractMap<K, V> | |
| ↳ | java.util.EnumMap<K extends java.lang.Enum<K>, V> | |
An Map specialized for use with Enum types as keys. 
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  | 
           Constructs an empty 
            EnumMapusing the given key type. | ||||||||||
|  | 
           Constructs an 
            EnumMapusing the same key type as the givenEnumMapand initially containing the same mappings. | ||||||||||
|  | 
           Constructs an 
            EnumMapinitialized from the given map. | ||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  | 
           Removes all elements from this 
            EnumMap, leaving it empty. | ||||||||||
|  | 
           Returns a shallow copy of this 
            EnumMap. | ||||||||||
|  | 
           Returns whether this 
            EnumMapcontains the specified key. | ||||||||||
|  | 
           Returns whether this 
            EnumMapcontains the specified value. | ||||||||||
|  | 
           Returns a 
            Setcontaining all of the mappings in thisEnumMap. | ||||||||||
|  | 
           Compares the argument to the receiver, and returns 
            trueif the specifiedObjectis anEnumMapand bothEnumMaps contain the same mappings. | ||||||||||
|  | 
           Returns the value of the mapping with the specified key.
           | ||||||||||
|  | 
           Returns a set of the keys contained in this 
            EnumMap. | ||||||||||
|  | 
           Maps the specified key to the specified value.
           | ||||||||||
|  | 
           Copies every mapping in the specified 
            Mapto thisEnumMap. | ||||||||||
|  | 
           Removes a mapping with the specified key from this 
            EnumMap. | ||||||||||
|  | 
           Returns the number of elements in this 
            EnumMap. | ||||||||||
|  | 
           Returns a 
            Collectionof the values contained in thisEnumMap. | ||||||||||
| [Expand] 
           Inherited Methods
           | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class java.util.AbstractMap | |||||||||||
|  From class java.lang.Object | |||||||||||
|  From interface java.util.Map | |||||||||||
Constructs an empty EnumMap using the given key type.
| keyType | the class object giving the type of the keys used by this EnumMap. | 
|---|
| NullPointerException | if keyTypeisnull. | 
|---|
Constructs an EnumMap using the same key type as the given EnumMap and initially containing the same mappings.
| map | the EnumMapfrom which thisEnumMapis initialized. | 
|---|
| NullPointerException | if mapisnull. | 
|---|
Constructs an EnumMap initialized from the given map. If the given map is an EnumMap instance, this constructor behaves in the exactly the same way as EnumMap(EnumMap)}. Otherwise, the given map should contain at least one mapping.
| map | the map from which this EnumMapis initialized. | 
|---|
| IllegalArgumentException | if mapis not anEnumMapinstance and does not contain any mappings. | 
|---|---|
| NullPointerException | if mapisnull. | 
Returns a shallow copy of this EnumMap.
EnumMap. Returns whether this EnumMap contains the specified key.
| key | the key to search for. | 
|---|
true if this EnumMap contains the specified key, false otherwise. Returns whether this EnumMap contains the specified value.
| value | the value to search for. | 
|---|
true if this EnumMap contains the specified value, false otherwise. Returns a Set containing all of the mappings in this EnumMap. Each mapping is an instance of Map.Entry. As the Set is backed by this EnumMap, changes in one will be reflected in the other. 
The order of the entries in the set will be the order that the enum keys were declared in.
Set of the mappings. Compares the argument to the receiver, and returns true if the specified Object is an EnumMap and both EnumMaps contain the same mappings.
| object | the Objectto compare with thisEnumMap. | 
|---|
true if object is the same as this EnumMap, false otherwise.Returns the value of the mapping with the specified key.
| key | the key. | 
|---|
null if no mapping for the specified key is found. Returns a set of the keys contained in this EnumMap. The Set is backed by this EnumMap so changes to one are reflected in the other. The Set does not support adding. 
The order of the set will be the order that the enum keys were declared in.
Set of the keys. Maps the specified key to the specified value.
| key | the key. | 
|---|---|
| value | the value. | 
null if there was no mapping.| UnsupportedOperationException | if adding to this map is not supported. | 
|---|---|
| ClassCastException | if the class of the key or value is inappropriate for this map. | 
| IllegalArgumentException | if the key or value cannot be added to this map. | 
| NullPointerException | if the key or value is nulland thisEnumMapdoes not supportnullkeys or values. | 
Copies every mapping in the specified Map to this EnumMap.
| map | the Mapto copy mappings from. | 
|---|
| UnsupportedOperationException | if adding to this EnumMapis not supported. | 
|---|---|
| ClassCastException | if the class of a key or value is inappropriate for this EnumMap. | 
| IllegalArgumentException | if a key or value cannot be added to this map. | 
| NullPointerException | if a key or value is nulland thisEnumMapdoes not supportnullkeys or values. | 
Removes a mapping with the specified key from this EnumMap.
| key | the key of the mapping to remove. | 
|---|
null if no mapping for the specified key was found.| UnsupportedOperationException | if removing from this EnumMapis not supported. | 
|---|
Returns the number of elements in this EnumMap.
EnumMap. Returns a Collection of the values contained in this EnumMap. The returned Collection complies with the general rule specified in values(). The Collection's Iterator will return the values in the their corresponding keys' natural order (the Enum constants are declared in this order). 
The order of the values in the collection will be the order that their corresponding enum keys were declared in.
EnumMap.