Package org.compiere.model
Class MultiMap<K,V>
java.lang.Object
org.compiere.model.MultiMap<K,V>
- Type Parameters:
K- KeyV- Value
- All Implemented Interfaces:
Serializable,Map<K,V>
MultiMap allows multiple keys with their values.
It accepts null values as keys and values.
(implemented as two array lists)
- Version:
- $Id: MultiMap.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear contentbooleancontainsKey(Object key) Contains KeybooleancontainsValue(Object value) Contains ValueentrySet()Get entry set - not implementedbooleanEquals - not implementedGet ArrayList of Values of KeyGet ArrayList of Keys with ValueGet ArrayList of Values of KeyinthashCode()booleanisEmpty()Is EmptykeySet()Return HashSet of Keysvoiddump all keys - values to logPut Key and ValuevoidPut allRemove keyintsize()Get number of elementstoString()Returns class name and number of entriesvalues()Return Collection of valuesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
MultiMap
public MultiMap()Constructor with 10 initial Capacity (same as ArrayList) -
MultiMap
public MultiMap(int initialCapacity) Constructor- Parameters:
initialCapacity- initial capacity
-
-
Method Details
-
size
public int size()Get number of elements -
isEmpty
public boolean isEmpty()Is Empty -
containsKey
Contains Key- Specified by:
containsKeyin interfaceMap<K,V> - Parameters:
key- key value- Returns:
- true if key exist
-
containsValue
Contains Value- Specified by:
containsValuein interfaceMap<K,V> - Parameters:
value- element value- Returns:
- true if value exists
-
get
Get ArrayList of Values of Key -
getValues
Get ArrayList of Values of Key- Parameters:
key- key- Returns:
- array list of values
-
getKeys
Get ArrayList of Keys with Value- Parameters:
value- value- Returns:
- array list of keys
-
put
Put Key and Value -
remove
Remove key -
putAll
Put all -
clear
public void clear()Clear content -
keySet
Return HashSet of Keys -
values
Return Collection of values -
entrySet
Get entry set - not implemented -
equals
Equals - not implemented -
hashCode
public int hashCode() -
toString
Returns class name and number of entries -
printToLog
public void printToLog()dump all keys - values to log
-