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>
public final class MultiMap<K,V> extends Object implements Map<K,V>, Serializable
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:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear contentboolean
containsKey(Object key)
Contains Keyboolean
containsValue(Object value)
Contains ValueSet<Map.Entry<K,V>>
entrySet()
Get entry set - not implementedboolean
equals(Object o)
Equals - not implementedV
get(Object key)
Return ArrayList of Values of KeyArrayList<K>
getKeys(Object value)
Return ArrayList of Keys with ValueArrayList<V>
getValues(Object key)
Return ArrayList of Values of Keyint
hashCode()
boolean
isEmpty()
Is EmptySet<K>
keySet()
Return HashSet of Keysvoid
printToLog()
dump all keys - values to logV
put(K key, V value)
Put Key and Valuevoid
putAll(Map<? extends K,? extends V> t)
Put allV
remove(Object key)
Remove keyint
size()
Return number of elementsString
toString()
Returns class name and number of entriesCollection<V>
values()
Return Collection of values-
Methods 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
-
-
-
-
Method Detail
-
size
public int size()
Return number of elements
-
isEmpty
public boolean isEmpty()
Is Empty
-
containsKey
public boolean containsKey(Object key)
Contains Key- Specified by:
containsKey
in interfaceMap<K,V>
- Parameters:
key
- test key- Returns:
- true if key exist
-
containsValue
public boolean containsValue(Object value)
Contains Value- Specified by:
containsValue
in interfaceMap<K,V>
- Parameters:
value
- test value- Returns:
- true if value exists
-
getValues
public ArrayList<V> getValues(Object key)
Return ArrayList of Values of Key- Parameters:
key
- key- Returns:
- array list of values
-
getKeys
public ArrayList<K> getKeys(Object value)
Return ArrayList of Keys with Value- Parameters:
value
- value- Returns:
- array list of keys
-
values
public Collection<V> values()
Return Collection of values
-
equals
public boolean equals(Object o)
Equals - not implemented
-
hashCode
public int hashCode()
-
toString
public String toString()
Returns class name and number of entries
-
printToLog
public void printToLog()
dump all keys - values to log
-
-