Module org.arakhne.afc.gis.giscore
Package org.arakhne.afc.gis.mapelement
Interface GISElementContainer<T extends MapElement>
-
- Type Parameters:
T
- is the type of the containing elements.
- All Superinterfaces:
BoundedElement2afp<Rectangle2d>
,GISContainer<T>
,InformedIterable<T>
,Iterable<T>
- All Known Implementing Classes:
ArrayMapElementLayer
,GridMapElementLayer
,MapElementLayer
,RoadNetworkLayer
,TreeMapElementLayer
public interface GISElementContainer<T extends MapElement> extends GISContainer<T>
Container of elements for a GIS application.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:53
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- giscore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addMapElement(T element)
Add a map element inside this container.boolean
addMapElements(Collection<? extends T> elements)
Add map elements inside this container.Collection<T>
getAllMapElements()
Replies the map elements as an array.URL
getElementAttributeSourceURL()
Replies the URL from which the attributes of the elements in this container were read.MapMetricProjection
getElementGeometrySourceProjection()
Replies the map projection of the data inside the file for which the URL is replied bygetElementGeometrySourceURL()
.URL
getElementGeometrySourceURL()
Replies the URL from which the geometry of the elements in this container were read.T
getMapElementAt(int index)
Replies the map element at the specified index.int
getMapElementCount()
Replies the count of map elements.Iterator<T>
iterator(Rectangle2afp<?,?,?,?,?,?> bounds)
Iterates on the elements that intersect the specified bounds.void
onMapElementGraphicalAttributeChanged()
Invoked when one of the graphical attributes of this element has changed, including those that change the bounding box.boolean
removeAllMapElements()
Remove all the map elements from this container.boolean
removeMapElement(MapElement element)
Remove a map element from this container.void
setElementAttributeSourceURL(URL url)
Set the URL from which the attributes of the elements in this container were read.void
setElementGeometrySource(URL url, MapMetricProjection mapProjection)
Set the URL from which the geometry of the elements in this container were read.-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.BoundedElement2afp
getBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISContainer
bindChangeListener, getColor, getName, resetBoundingBox, size
-
Methods inherited from interface org.arakhne.afc.util.InformedIterable
getElementType
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
getMapElementCount
int getMapElementCount()
Replies the count of map elements.- Returns:
- the count of map elements.
-
getMapElementAt
T getMapElementAt(int index)
Replies the map element at the specified index.- Parameters:
index
- the index.- Returns:
- the element at the given index
- Throws:
IndexOutOfBoundsException
- in case of error.
-
getAllMapElements
Collection<T> getAllMapElements()
Replies the map elements as an array.- Returns:
- all the elements.
-
addMapElements
boolean addMapElements(Collection<? extends T> elements)
Add map elements inside this container.- Parameters:
elements
- the new elements.- Returns:
true
if at least one element was added, otherwisefalse
-
addMapElement
boolean addMapElement(T element)
Add a map element inside this container.- Parameters:
element
- the new element.- Returns:
true
if the element was added successfully, otherwisefalse
-
removeMapElement
boolean removeMapElement(MapElement element)
Remove a map element from this container.- Parameters:
element
- the element to remove.- Returns:
true
if the element was removed successfully, otherwisefalse
-
removeAllMapElements
boolean removeAllMapElements()
Remove all the map elements from this container.- Returns:
true
if container has changed, otherwisefalse
- Since:
- 4.0
-
onMapElementGraphicalAttributeChanged
void onMapElementGraphicalAttributeChanged()
Invoked when one of the graphical attributes of this element has changed, including those that change the bounding box.
-
getElementGeometrySourceURL
URL getElementGeometrySourceURL()
Replies the URL from which the geometry of the elements in this container were read.Basically, the replied URL may be the URL of a ESRI Shape file.
- Returns:
- the URL of the source of the geometry of
the elements, or
null
if no known source.
-
getElementGeometrySourceProjection
MapMetricProjection getElementGeometrySourceProjection()
Replies the map projection of the data inside the file for which the URL is replied bygetElementGeometrySourceURL()
.- Returns:
- the map projection of the data, or
null
ifgetElementGeometrySourceURL()
repliesnull
. - Since:
- 4.1
-
getElementAttributeSourceURL
URL getElementAttributeSourceURL()
Replies the URL from which the attributes of the elements in this container were read.Basically, the replied URL may be the URL of a dBase file.
- Returns:
- the URL of the source of the attributes of
the elements, or
null
if no known source.
-
setElementAttributeSourceURL
void setElementAttributeSourceURL(URL url)
Set the URL from which the attributes of the elements in this container were read.Basically, the URL may be the URL of a dBase file.
- Parameters:
url
- is the URL of the source of the attributes of the elements, ornull
if no known source.
-
setElementGeometrySource
void setElementGeometrySource(URL url, MapMetricProjection mapProjection)
Set the URL from which the geometry of the elements in this container were read.Basically, the URL may be the URL of a ESRI Shape file.
- Parameters:
url
- is the URL of the source of the geometry of the elements, ornull
if no known source.mapProjection
- is the map projection used to describe the data inside the file with the given URL.- Since:
- 4.1
-
iterator
@Pure Iterator<T> iterator(Rectangle2afp<?,?,?,?,?,?> bounds)
Iterates on the elements that intersect the specified bounds.- Parameters:
bounds
- is the rectangle inside which the replied elements must be located- Returns:
- an iterator on the map elements.
- Since:
- 14.0
-
-