Class IdMultiHashMap<V>
java.lang.Object
net.okapia.osid.torrefacto.collect.MultiHashMap<Id,V>
net.okapia.osid.torrefacto.collect.IdMultiHashMap<V>
- Type Parameters:
V- the value type
A
MultiHashMap whose keys are hardened to
org.osid.id.Id. It adds no behavior beyond fixing the
key type; all map operations are inherited.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an emptyMultiHashMapwith the default initial capacity (16) and the default load factor (0.75).IdMultiHashMap(int initialCapacity) Constructs an emptyMultiHashMapwith the specified initial capacity and the default load factor (0.75).IdMultiHashMap(int initialCapacity, float loadFactor) Constructs an emptyMultiHashMapwith the specified initial capacity and load factor. -
Method Summary
Methods inherited from class MultiHashMap
asMap, clear, containsKey, containsKeyValue, containsValue, get, isEmpty, isModifiable, keySet, put, putAll, putAll, putAll, remove, remove, removeValue, size, valuesModifier and TypeMethodDescriptionMap<Id, Collection<V>> asMap()Gets a Map of this MultiMap.voidclear()Removes all of the mappings from this map.booleancontainsKey(Id key) Tests if this map contains a mapping for the specified key.booleancontainsKeyValue(Id key, V value) Tests the map contains the key and value specified.booleancontainsValue(V value) Tests the map contains the value specified.Returns the values to which the specified key is mapped.booleanisEmpty()Tests if this map contains no key-value mappings.booleanTests if this map can be modified.keySet()Returns an immutable Collection view of the keys contained in this map.voidAssociates the specified value with the specified key in this map.voidputAll(Map<Id, Collection<? extends V>> map) Stores a map of keys and values inside this map.voidputAll(Id key, Collection<? extends V> values) Adds a collection of values to to a key in this map.voidStores a Multimap inside this map.voidRemoves the mapping for a key and all its related values.voidRemoves a specific key/value pair from the map.voidremoveValue(V value) Removes a value from all keys.longsize()Returns the number of key-value mappings in this map.values()Returns a Collection view of the values contained in this map.
-
Constructor Details
-
IdMultiHashMap
public IdMultiHashMap()Constructs an emptyMultiHashMapwith the default initial capacity (16) and the default load factor (0.75). -
IdMultiHashMap
public IdMultiHashMap(int initialCapacity) Constructs an emptyMultiHashMapwith the specified initial capacity and the default load factor (0.75).- Parameters:
initialCapacity- the initial capacity.- Throws:
IllegalArgumentException- if the initial capacity is negative.
-
IdMultiHashMap
public IdMultiHashMap(int initialCapacity, float loadFactor) Constructs an emptyMultiHashMapwith the specified initial capacity and load factor.- Parameters:
initialCapacity- the initial capacityloadFactor- the load factor- Throws:
IllegalArgumentException- if the initial capacity is negative or the load factor is nonpositive
-