Module org.arakhne.afc.gis.giscore
Package org.arakhne.afc.gis.tree
Class StandardGISTreeSet<P extends GISPrimitive>
- java.lang.Object
-
- org.arakhne.afc.gis.tree.AbstractGISTreeSet<P,GISTreeSetNode<P>>
-
- org.arakhne.afc.gis.tree.StandardGISTreeSet<P>
-
- Type Parameters:
P
- is the type of the user data inside the node.
- All Implemented Interfaces:
Iterable<P>
,Collection<P>
,Set<P>
,GISSet<P>
,GISTreeSet<P,GISTreeSetNode<P>>
,GISTreeSetNodeFactory<P,GISTreeSetNode<P>>
- Direct Known Subclasses:
MapElementTreeSet
public class StandardGISTreeSet<P extends GISPrimitive> extends AbstractGISTreeSet<P,GISTreeSetNode<P>> implements GISTreeSetNodeFactory<P,GISTreeSetNode<P>>
This class describes a quad tree that contains GIS primitives and thatp permits to find them according to there geo-location.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:53
- Author:
- Stéphane GALLAND
- See Also:
GISPrimitive
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- giscore
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.gis.tree.AbstractGISTreeSet
worldBounds
-
-
Constructor Summary
Constructors Constructor Description StandardGISTreeSet()
Create an empty tree.StandardGISTreeSet(double boundsX, double boundsY, double boundsWidth, double boundsHeight)
Constructor.StandardGISTreeSet(Rectangle2afp<?,?,?,?,?,?> bounds)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(P elt)
GISTreeSetNodeFactory<P,GISTreeSetNode<P>>
getNodeFactory()
Replies the node factory used by this tree.GISTreeSetNode<P>
newNode(IcosepQuadTreeNode.IcosepQuadTreeZone zone, double boundsX, double boundsY, double boundsWidth, double boundsHeight)
Create a root node with the given element inside.GISTreeSetNode<P>
newRootNode(P element)
Create a root node with the given element inside.GISTreeSetNode<P>
newRootNode(P element, double boundsX, double boundsY, double boundsWidth, double boundsHeight)
Create a root node with the given element inside.void
setNodeFactory(GISTreeSetNodeFactory<P,GISTreeSetNode<P>> factory)
Set the node factory used by this tree.-
Methods inherited from class org.arakhne.afc.gis.tree.AbstractGISTreeSet
addAll, boundsIterator, clear, computeSize, contains, containsAll, extractClassFrom, get, get, get, getElementType, getTree, getTreeNodeAt, indexOf, isEmpty, isTypeRecomputedAfterRemoval, iterator, iterator, iterator, nodeIterator, remove, removeAll, retainAll, setTypeRecomputedAfterRemoval, size, slowContains, toArray, toArray, toIterable, toIterable, toString, updateComponentType, updateComponentType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
-
-
-
Constructor Detail
-
StandardGISTreeSet
public StandardGISTreeSet()
Create an empty tree.
-
StandardGISTreeSet
public StandardGISTreeSet(Rectangle2afp<?,?,?,?,?,?> bounds)
Constructor.- Parameters:
bounds
- are the bounds of the scene stored inside this tree.
-
StandardGISTreeSet
public StandardGISTreeSet(double boundsX, double boundsY, double boundsWidth, double boundsHeight)
Constructor.- Parameters:
boundsX
- is the bounds of the scene.boundsY
- is the bounds of the scene.boundsWidth
- is the bounds of the scene.boundsHeight
- is the bounds of the scene.
-
-
Method Detail
-
add
public final boolean add(P elt)
- Specified by:
add
in interfaceCollection<P extends GISPrimitive>
- Specified by:
add
in interfaceSet<P extends GISPrimitive>
-
setNodeFactory
public void setNodeFactory(GISTreeSetNodeFactory<P,GISTreeSetNode<P>> factory)
Set the node factory used by this tree.- Specified by:
setNodeFactory
in interfaceGISTreeSet<P extends GISPrimitive,GISTreeSetNode<P extends GISPrimitive>>
- Specified by:
setNodeFactory
in classAbstractGISTreeSet<P extends GISPrimitive,GISTreeSetNode<P extends GISPrimitive>>
- Parameters:
factory
- the node factory.
-
getNodeFactory
@Pure public GISTreeSetNodeFactory<P,GISTreeSetNode<P>> getNodeFactory()
Replies the node factory used by this tree.- Specified by:
getNodeFactory
in interfaceGISTreeSet<P extends GISPrimitive,GISTreeSetNode<P extends GISPrimitive>>
- Specified by:
getNodeFactory
in classAbstractGISTreeSet<P extends GISPrimitive,GISTreeSetNode<P extends GISPrimitive>>
- Returns:
- the factory
-
newRootNode
@Pure public GISTreeSetNode<P> newRootNode(P element)
Description copied from interface:GISTreeSetNodeFactory
Create a root node with the given element inside.- Specified by:
newRootNode
in interfaceGISTreeSetNodeFactory<P extends GISPrimitive,GISTreeSetNode<P extends GISPrimitive>>
- Parameters:
element
- is the element to initially put inside the node.- Returns:
- the node
-
newRootNode
@Pure public GISTreeSetNode<P> newRootNode(P element, double boundsX, double boundsY, double boundsWidth, double boundsHeight)
Description copied from interface:GISTreeSetNodeFactory
Create a root node with the given element inside.- Specified by:
newRootNode
in interfaceGISTreeSetNodeFactory<P extends GISPrimitive,GISTreeSetNode<P extends GISPrimitive>>
- Parameters:
element
- is the element to initially put inside the node.boundsX
- is the bounds of the scene.boundsY
- is the bounds of the scene.boundsWidth
- is the bounds of the scene.boundsHeight
- is the bounds of the scene.- Returns:
- the node
-
newNode
@Pure public GISTreeSetNode<P> newNode(IcosepQuadTreeNode.IcosepQuadTreeZone zone, double boundsX, double boundsY, double boundsWidth, double boundsHeight)
Description copied from interface:GISTreeSetNodeFactory
Create a root node with the given element inside.- Specified by:
newNode
in interfaceGISTreeSetNodeFactory<P extends GISPrimitive,GISTreeSetNode<P extends GISPrimitive>>
- Parameters:
zone
- is the zone enclosed by this node.boundsX
- is the bounds of the scene.boundsY
- is the bounds of the scene.boundsWidth
- is the bounds of the scene.boundsHeight
- is the bounds of the scene.- Returns:
- the node
-
-