Module org.arakhne.afc.gis.giscore
Package org.arakhne.afc.gis
Interface GISSet<P extends GISPrimitive>
-
- Type Parameters:
P
- is the type of the user data inside the node.
- All Superinterfaces:
Collection<P>
,Iterable<P>
,Set<P>
- All Known Subinterfaces:
GISElementSet<P>
,GISPolylineSet<P>
- All Known Implementing Classes:
AbstractGISGridSet
,AbstractGISTreeSet
,MapElementGridSet
,MapElementTreeSet
,MapPolylineGridSet
,MapPolylineTreeSet
,StandardGISGridSet
,StandardGISTreeSet
,WeakGISTreeSet
public interface GISSet<P extends GISPrimitive> extends Set<P>
This interface describes a set that contains GIS primitives and that 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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Iterator<Rectangle2afp<?,?,?,?,?,?>>
boundsIterator()
Replies the bounding rectangles of the internal data-structure elements.int
computeSize()
Force the deep computation of the element count in this set.P
get(int index)
Replies the element at the specified index.P
get(GeoId identifier)
Replies the element which as the specified identifier.P
get(GeoLocation location)
Replies the element which as the specified location.Class<? extends P>
getElementType()
Replies the class of the components in this list.int
indexOf(Object obj)
Replies the index of the first instance the specified element.boolean
isTypeRecomputedAfterRemoval()
Replies if this informed tree set is trying to compute the best fitting type after a removal.Iterator<P>
iterator(Rectangle2afp<?,?,?,?,?,?> clipBounds)
Replies the set of elements that have an intersection with the specified rectangle.Iterator<P>
iterator(Rectangle2afp<?,?,?,?,?,?> clipBounds, int budget)
Replies the set of elements that have an intersection with the specified rectangle.void
setTypeRecomputedAfterRemoval(boolean update)
Set if this informed tree set is trying to compute the best fitting type after a removal.boolean
slowContains(Object obj)
Replies if the given object is inside the set by user a depth-first iteration on the internal tree.Iterable<P>
toIterable(Rectangle2afp<?,?,?,?,?,?> clipBounds)
Replies the set of elements that have an intersection with the specified rectangle.Iterable<P>
toIterable(Rectangle2afp<?,?,?,?,?,?> clipBounds, int budget)
Replies the set of elements that have an intersection with the specified rectangle.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Method Detail
-
isTypeRecomputedAfterRemoval
boolean isTypeRecomputedAfterRemoval()
Replies if this informed tree set is trying to compute the best fitting type after a removal. Iffalse
, this class will keep unchanged the previously computed type.- Returns:
true
if the type is recomputed after a removal,false
if not.
-
setTypeRecomputedAfterRemoval
void setTypeRecomputedAfterRemoval(boolean update)
Set if this informed tree set is trying to compute the best fitting type after a removal. Iffalse
, this class will keep unchanged the previously computed type.- Parameters:
update
- istrue
if the type is recomputed after a removal,false
if not.
-
getElementType
Class<? extends P> getElementType()
Replies the class of the components in this list.- Returns:
- the top most type of the array's elements.
-
get
P get(GeoId identifier)
Replies the element which as the specified identifier.This function is time consuming because the location of the primitive could not be retreived from the geoId.
- Parameters:
identifier
- is the identifier to text.- Returns:
- the entity or
null
if none was found.
-
get
P get(GeoLocation location)
Replies the element which as the specified location.- Parameters:
location
- is the location of the element to find.- Returns:
- the entity or
null
if none was found.
-
get
P get(int index)
Replies the element at the specified index.This method iterates until the right index.
- Parameters:
index
- the index.- Returns:
- the element at the given index.
- Throws:
IndexOutOfBoundsException
- in case of error.
-
computeSize
int computeSize()
Force the deep computation of the element count in this set.- Returns:
- the count of elements inside the tree.
-
slowContains
boolean slowContains(Object obj)
Replies if the given object is inside the set by user a depth-first iteration on the internal tree.- Parameters:
obj
- the object.- Returns:
true
of o is inside, otherwisefalse
- See Also:
Set.contains(Object)
-
indexOf
int indexOf(Object obj)
Replies the index of the first instance the specified element.This method iterates until the right index.
- Parameters:
obj
- the object to search for.- Returns:
- the index or
-1
if the object was not inside this set.
-
iterator
Iterator<P> iterator(Rectangle2afp<?,?,?,?,?,?> clipBounds)
Replies the set of elements that have an intersection with the specified rectangle.This function replies the elements with a broad-first iteration on the elements' tree.
- Parameters:
clipBounds
- is the bounds outside which the elements will not be replied- Returns:
- the elements inside the specified bounds.
-
iterator
Iterator<P> iterator(Rectangle2afp<?,?,?,?,?,?> clipBounds, int budget)
Replies the set of elements that have an intersection with the specified rectangle.This function replies the elements with a broad-first iteration on the elements' tree.
- Parameters:
clipBounds
- is the bounds outside which the elements will not be repliedbudget
- is the maximal size of the replied list. If this value is negative, all the elements will be replied.- Returns:
- the elements inside the specified bounds.
-
boundsIterator
Iterator<Rectangle2afp<?,?,?,?,?,?>> boundsIterator()
Replies the bounding rectangles of the internal data-structure elements.- Returns:
- the bounding boxes in the data-structure.
-
toIterable
Iterable<P> toIterable(Rectangle2afp<?,?,?,?,?,?> clipBounds)
Replies the set of elements that have an intersection with the specified rectangle.This function replies the elements with a broad-first iteration on the elements' tree.
- Parameters:
clipBounds
- is the bounds outside which the elements will not be replied- Returns:
- the elements inside the specified bounds.
-
toIterable
Iterable<P> toIterable(Rectangle2afp<?,?,?,?,?,?> clipBounds, int budget)
Replies the set of elements that have an intersection with the specified rectangle.This function replies the elements with a broad-first iteration on the elements' tree.
- Parameters:
clipBounds
- is the bounds outside which the elements will not be repliedbudget
- is the maximal size of the replied list. If this value is negative, all the elements will be replied.- Returns:
- the elements inside the specified bounds.
-
-