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 voidaddItem(Object key, Object item)Adds the item to the Collection at the given key, creating a new Collection if necessary.voidaddItems(Object key, Collection items)Adds the items to the Collection at the given key, creating a new Collection if necessary.voidaddItems(CollectionMap other)voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)SetentrySet()Objectget(Object key)CollectiongetItems(Object key)MapgetMap()booleanisEmpty()SetkeySet()Returns the keys.Objectput(Object key, Object value)voidputAll(Map map)Objectremove(Object key)voidremoveItem(Object key, Object item)voidremoveItems(Object key, Collection items)intsize()Returns the number of mappings.Collectionvalues()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:
containsKeyin interfaceMap
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap
-
removeItems
public void removeItems(Object key, Collection items)
-
getMap
public Map getMap()
-
-