public class CollectionMap
extends java.lang.Object
implements java.util.Map
| Constructor and Description |
|---|
CollectionMap()
Creates a CollectionMap.
|
CollectionMap(java.lang.Class mapClass)
Creates a CollectionMap backed by the given Map class.
|
CollectionMap(java.lang.Class mapClass,
java.lang.Class collectionClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(java.lang.Object key,
java.lang.Object item)
Adds the item to the Collection at the given key, creating a new Collection if
necessary.
|
void |
addItems(CollectionMap other) |
void |
addItems(java.lang.Object key,
java.util.Collection items)
Adds the items to the Collection at the given key, creating a new Collection if
necessary.
|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set |
entrySet() |
java.lang.Object |
get(java.lang.Object key) |
java.util.Collection |
getItems(java.lang.Object key) |
java.util.Map |
getMap() |
boolean |
isEmpty() |
java.util.Set |
keySet()
Returns the keys.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value) |
void |
putAll(java.util.Map map) |
java.lang.Object |
remove(java.lang.Object key) |
void |
removeItem(java.lang.Object key,
java.lang.Object item) |
void |
removeItems(java.lang.Object key,
java.util.Collection items) |
int |
size()
Returns the number of mappings.
|
java.util.Collection |
values()
Returns the values.
|
public CollectionMap(java.lang.Class mapClass)
mapClass - a Class that implements Mappublic CollectionMap(java.lang.Class mapClass,
java.lang.Class collectionClass)
public CollectionMap()
public void addItem(java.lang.Object key,
java.lang.Object item)
key - the key to the Collection to which the item should be addeditem - the item to addpublic void removeItem(java.lang.Object key,
java.lang.Object item)
public void clear()
clear in interface java.util.Mappublic void addItems(java.lang.Object key,
java.util.Collection items)
key - the key to the Collection to which the items should be addeditems - the items to addpublic void addItems(CollectionMap other)
public java.util.Collection values()
values in interface java.util.Mappublic java.util.Set keySet()
keySet in interface java.util.Mappublic int size()
size in interface java.util.Mappublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Mappublic java.util.Collection getItems(java.lang.Object key)
public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mappublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Mappublic boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Mappublic java.util.Set entrySet()
entrySet in interface java.util.Mappublic boolean isEmpty()
isEmpty in interface java.util.Mappublic java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mappublic void putAll(java.util.Map map)
putAll in interface java.util.Mappublic void removeItems(java.lang.Object key,
java.util.Collection items)
public java.util.Map getMap()