Package jadex.commons.collection
Class CheckedMap
- java.lang.Object
- 
- jadex.commons.collection.CheckedMap
 
- 
- All Implemented Interfaces:
- java.util.Map
 
 public class CheckedMap extends java.lang.Object implements java.util.Map
- 
- 
Constructor SummaryConstructors Constructor Description CheckedMap(java.util.Map map)Create a new collection.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all of the mappings from this map (optional operation).booleancontainsKey(java.lang.Object key)ReturnsbooleancontainsValue(java.lang.Object value)Returnsjava.util.SetentrySet()Returns aSetview of the mappings contained in this map.booleanequals(java.lang.Object o)Compares the specified object with this map for equality.java.lang.Objectget(java.lang.Object key)Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.inthashCode()Returns the hash code value for this map.booleanisEmpty()Returnsjava.util.SetkeySet()Returns aSetview of the keys contained in this map.java.lang.Objectput(java.lang.Object key, java.lang.Object value)Associates the specified value with the specified key in this map (optional operation).voidputAll(java.util.Map m)Copies all of the mappings from the specified map to this map (optional operation).java.lang.Objectremove(java.lang.Object key)Removes the mapping for a key from this map if it is present (optional operation).intsize()Returns the number of key-value mappings in this map.java.util.Collectionvalues()Returns aCollectionview of the values contained in this map.
 
- 
- 
- 
Method Detail- 
sizepublic int size() Returns the number of key-value mappings in this map. If the map contains more than- Specified by:
- sizein interface- java.util.Map
- Returns:
- the number of key-value mappings in this map
 - 
isEmptypublic boolean isEmpty() Returns- Specified by:
- isEmptyin interface- java.util.Map
- Returns:
 - 
containsKeypublic boolean containsKey(java.lang.Object key) Returns- Specified by:
- containsKeyin interface- java.util.Map
- Parameters:
- key- key whose presence in this map is to be tested
- Returns:
- 
- Throws:
java.lang.ClassCastException- if the key is of an inappropriate type for this map (optional)java.lang.NullPointerException- if the specified key is null and this map does not permit null keys (optional)
 - 
containsValuepublic boolean containsValue(java.lang.Object value) Returns- Specified by:
- containsValuein interface- java.util.Map
- Parameters:
- value- value whose presence in this map is to be tested
- Returns:
- 
- Throws:
java.lang.ClassCastException- if the value is of an inappropriate type for this map (optional)java.lang.NullPointerException- if the specified value is null and this map does not permit null values (optional)
 - 
getpublic java.lang.Object get(java.lang.Object key) Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.k to a value vsuch that(key==null ? k==null : key.equals(k)), then this method returnsv; otherwise it returnsnull. (There can be at most one such mapping.)null does not null. The containsKeyoperation may be used to distinguish these two cases.- Specified by:
- getin interface- java.util.Map
- Parameters:
- key- the key whose associated value is to be returned
- Returns:
- the value to which the specified key is mapped, or
         nullif this map contains no mapping for the key
- Throws:
- java.lang.ClassCastException- if the key is of an inappropriate type for this map (optional)
- java.lang.NullPointerException- if the specified key is null and this map does not permit null keys (optional)
 
 - 
putpublic java.lang.Object put(java.lang.Object key, java.lang.Object value)Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A mapm.containsKey(k)would return- Specified by:
- putin interface- java.util.Map
- Parameters:
- key- key with which the specified value is to be associated
- value- value to be associated with the specified key
- Returns:
- the previous value associated with 
- Throws:
java.lang.UnsupportedOperationException- if thejava.lang.ClassCastException- if the class of the specified key or value prevents it from being stored in this mapjava.lang.NullPointerException- if the specified key or value is null and this map does not permit null keys or valuesjava.lang.IllegalArgumentException- if some property of the specified key or value prevents it from being stored in this map
 - 
removepublic java.lang.Object remove(java.lang.Object key) Removes the mapping for a key from this map if it is present (optional operation). More formally, if this map contains a mapping from key (key==null ? k==null : key.equals(k)), that mapping is removed. (The map can contain at most one such mapping.)- Specified by:
- removein interface- java.util.Map
- Parameters:
- key- key whose mapping is to be removed from the map
- Returns:
- the previous value associated with 
- Throws:
java.lang.UnsupportedOperationException- if thejava.lang.ClassCastException- if the key is of an inappropriate type for this map (optional)java.lang.NullPointerException- if the specified key is null and this map does not permit null keys (optional)
 - 
putAllpublic void putAll(java.util.Map m) Copies all of the mappings from the specified map to this map (optional operation). The effect of this call is equivalent to that of callingput(k, v)on this map once for each mapping from key- Specified by:
- putAllin interface- java.util.Map
- Parameters:
- m- mappings to be stored in this map
- Throws:
- java.lang.UnsupportedOperationException- if the- java.lang.ClassCastException- if the class of a key or value in the specified map prevents it from being stored in this map- java.lang.NullPointerException- if the specified map is null, or if this map does not permit null keys or values, and the specified map contains null keys or values- java.lang.IllegalArgumentException- if some property of a key or value in the specified map prevents it from being stored in this map
 - 
clearpublic void clear() Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.- Specified by:
- clearin interface- java.util.Map
- Throws:
- java.lang.UnsupportedOperationException- if the
 
 - 
keySetpublic java.util.Set keySet() Returns aSetview of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own- Specified by:
- keySetin interface- java.util.Map
- Returns:
- a set view of the keys contained in this map
 - 
valuespublic java.util.Collection values() Returns aCollectionview of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own- Specified by:
- valuesin interface- java.util.Map
- Returns:
- a collection view of the values contained in this map
 - 
entrySetpublic java.util.Set entrySet() Returns aSetview of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own- Specified by:
- entrySetin interface- java.util.Map
- Returns:
- a set view of the mappings contained in this map
 - 
equalspublic boolean equals(java.lang.Object o) Compares the specified object with this map for equality. Returns- Specified by:
- equalsin interface- java.util.Map
- Overrides:
- equalsin class- java.lang.Object
- Parameters:
- o- object to be compared for equality with this map
- Returns:
 - 
hashCodepublic int hashCode() Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hash codes of each entry in the map's Object.hashCode().- Specified by:
- hashCodein interface- java.util.Map
- Overrides:
- hashCodein class- java.lang.Object
- Returns:
- the hash code value for this map
- See Also:
- Map.Entry.hashCode(),- Object.equals(Object),- equals(Object)
 
 
 
 
 
 
 
 
 
 
 
 
 
- 
 
-