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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear contentboolean
containsKey
(Object key) Contains Keyboolean
containsValue
(Object value) Contains ValueentrySet()
Get entry set - not implementedboolean
Equals - not implementedGet ArrayList of Values of KeyGet ArrayList of Keys with ValueGet ArrayList of Values of Keyint
hashCode()
boolean
isEmpty()
Is EmptykeySet()
Return HashSet of Keysvoid
dump all keys - values to logPut Key and Valuevoid
Put allRemove keyint
size()
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, wait
Methods 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:
containsKey
in interfaceMap<K,
V> - Parameters:
key
- key value- Returns:
- true if key exist
-
containsValue
Contains Value- Specified by:
containsValue
in 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
-