public class MultiMap<V> extends HashMap<String,List<V>>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
MultiMap() |
MultiMap(Map<String,List<V>> map) |
MultiMap(MultiMap<V> map) |
Modifier and Type | Method and Description |
---|---|
void |
add(String name,
V value)
Add value to multi valued entry.
|
boolean |
addAllValues(MultiMap<V> map)
Merge values.
|
void |
addValues(String name,
List<V> values)
Add values to multi valued entry.
|
void |
addValues(String name,
V[] values)
Add values to multi valued entry.
|
boolean |
containsSimpleValue(V value)
Test for a specific single value in the map.
|
String |
getString(String name)
Get value as String.
|
V |
getValue(String name,
int i)
Get a value from a multiple value.
|
List<V> |
getValues(String name)
Get multiple values.
|
List<V> |
put(String name,
V value)
Put multi valued entry.
|
void |
putAllValues(Map<String,V> input)
Shorthand version of putAll
|
List<V> |
putValues(String name,
List<V> values)
Put multi valued entry.
|
List<V> |
putValues(String name,
V... values)
Put multi valued entry.
|
boolean |
removeValue(String name,
V value)
Remove value.
|
String |
toString() |
Map<String,String[]> |
toStringArrayMap() |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode
public List<V> getValues(String name)
name
- The entry key.public V getValue(String name, int i)
name
- The entry key.i
- Index of element to get.public String getString(String name)
name
- The entry key.public List<V> put(String name, V value)
name
- The entry key.value
- The simple valuepublic void putAllValues(Map<String,V> input)
input
- the input mappublic List<V> putValues(String name, List<V> values)
name
- The entry key.values
- The List of multiple values.@SafeVarargs public final List<V> putValues(String name, V... values)
name
- The entry key.values
- The array of multiple values.public void add(String name, V value)
name
- The entry key.value
- The entry value.public void addValues(String name, List<V> values)
name
- The entry key.values
- The List of multiple values.public void addValues(String name, V[] values)
name
- The entry key.values
- The String array of multiple values.public boolean addAllValues(MultiMap<V> map)
map
- the map to overlay on top of this one, merging together values if needed.public boolean removeValue(String name, V value)
name
- The entry key.value
- The entry value.public boolean containsSimpleValue(V value)
NOTE: This is a SLOW operation, and is actively discouraged.
value
- Copyright © 1995-2015 Webtide. All Rights Reserved.