Class NodeMap<V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<V,Rectangle2D>
-
- org.jungrapht.visualization.spatial.rtree.NodeMap<V>
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<V,Rectangle2D>,Bounded,BoundedMap<V>
public class NodeMap<V> extends HashMap<V,Rectangle2D> implements BoundedMap<V>, Bounded
A Map of elements to Rectangle2D where the union of the child elements is kept up to date with the values in the Map- Author:
- Tom Nelson
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Rectangle2DgetBounds()return the Rectangle of the bounding boxvoidput(Map.Entry<V,Rectangle2D> entry)Rectangle2Dput(V n, Rectangle2D b)voidrecalculateBounds()iterate over all children and update the bounds Called after removing from the collectionRectangle2Dremove(Object o)-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
NodeMap
public NodeMap()
-
NodeMap
public NodeMap(int initialCapacity)
-
NodeMap
public NodeMap(Map<V,Rectangle2D> map)
-
-
Method Detail
-
put
public void put(Map.Entry<V,Rectangle2D> entry)
-
put
public Rectangle2D put(V n, Rectangle2D b)
- Specified by:
putin interfaceMap<V,Rectangle2D>- Overrides:
putin classHashMap<V,Rectangle2D>
-
remove
public Rectangle2D remove(Object o)
- Specified by:
removein interfaceMap<V,Rectangle2D>- Overrides:
removein classHashMap<V,Rectangle2D>
-
clear
public void clear()
- Specified by:
clearin interfaceMap<V,Rectangle2D>- Overrides:
clearin classHashMap<V,Rectangle2D>
-
getBounds
public Rectangle2D getBounds()
Description copied from interface:Boundedreturn the Rectangle of the bounding box- Specified by:
getBoundsin interfaceBounded- Specified by:
getBoundsin interfaceBoundedMap<V>- Returns:
- the rectangular bounds of the implementation
-
recalculateBounds
public void recalculateBounds()
iterate over all children and update the bounds Called after removing from the collection- Specified by:
recalculateBoundsin interfaceBoundedMap<V>
-
-