EnumMapK extends EnumK,V


EnumMap<K extends Enum<K>,V> java.util

Java 5.0 cloneable serializable collection

This class is a Map implementation for use with enumerated types. The key type K must be an enumerated type, and all keys must be enumerated constants defined by that type. null keys are not permitted. The value type V is unrestricted and null values are permitted.

The EnumMap implementation is based on an array of elements of type V . The length of this array is the same as the number of constants defined by the enumerated type K . All Map operations execute in constant time. The iterators of the keySet( ) , enTRySet( ) , and values( ) collections iterate their elements in the ordinal order of the enumerated constants. EnumMap is not threadsafe, but its iterators are based on a snapshot of the underlying array and never throw ConcurrentModificationException .

Figure 16-16. java.util.EnumMap<K extends Enum<K>,V>

 public class  EnumMap<K extends Enum<K>,V>  extends AbstractMap<K,V> implements Serializable, Cloneable {  // Public Constructors  public  EnumMap  (EnumMap<K,? extends V>  m  );        public  EnumMap  (Class<K>  keyType  );        public  EnumMap  (Map<K,? extends V>  m  );  // Public Instance Methods  public EnumMap<K,V>  clone  ( );        public V  put  (K  key  , V  value  );  // Public Methods Overriding AbstractMap  public void  clear  ( );        public boolean  containsKey  (Object  key  );        public boolean  containsValue  (Object  value  );        public Set<Map.Entry<K,V>>  entrySet  ( );        public boolean  equals  (Object  o  );        public V  get  (Object  key  );        public Set<K>  keySet  ( );        public void  putAll  (Map<? extends K,? extends V>  m  );        public V  remove  (Object  key  );        public int  size  ( );        public Collection<V>  values  ( );   } 



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net