Package org.locationtech.jts.jump.util
Class CollectionMap
- java.lang.Object
-
- org.locationtech.jts.jump.util.CollectionMap
-
-
Constructor Summary
Constructors Constructor Description CollectionMap()
Creates a CollectionMap.CollectionMap(Class mapClass)
Creates a CollectionMap backed by the given Map class.CollectionMap(Class mapClass, Class collectionClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItem(Object key, Object item)
Adds the item to the Collection at the given key, creating a new Collection if necessary.void
addItems(Object key, Collection items)
Adds the items to the Collection at the given key, creating a new Collection if necessary.void
addItems(CollectionMap other)
void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set
entrySet()
Object
get(Object key)
Collection
getItems(Object key)
Map
getMap()
boolean
isEmpty()
Set
keySet()
Returns the keys.Object
put(Object key, Object value)
void
putAll(Map map)
Object
remove(Object key)
void
removeItem(Object key, Object item)
void
removeItems(Object key, Collection items)
int
size()
Returns the number of mappings.Collection
values()
Returns the values.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
CollectionMap
public CollectionMap(Class mapClass)
Creates a CollectionMap backed by the given Map class.- Parameters:
mapClass
- a Class that implements Map
-
CollectionMap
public CollectionMap()
Creates a CollectionMap.
-
-
Method Detail
-
addItem
public void addItem(Object key, Object item)
Adds the item to the Collection at the given key, creating a new Collection if necessary.- Parameters:
key
- the key to the Collection to which the item should be addeditem
- the item to add
-
addItems
public void addItems(Object key, Collection items)
Adds the items to the Collection at the given key, creating a new Collection if necessary.- Parameters:
key
- the key to the Collection to which the items should be addeditems
- the items to add
-
addItems
public void addItems(CollectionMap other)
-
values
public Collection values()
Returns the values.
-
keySet
public Set keySet()
Returns the keys.
-
size
public int size()
Returns the number of mappings.
-
getItems
public Collection getItems(Object key)
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap
-
removeItems
public void removeItems(Object key, Collection items)
-
getMap
public Map getMap()
-
-