Module org.arakhne.afc.gis.giscore
Package org.arakhne.afc.gis.primitive
Class AbstractBoundedGISElement<C extends GISContainer<?>,T extends AbstractBoundedGISElement<C,T>>
- java.lang.Object
-
- org.arakhne.afc.gis.primitive.AbstractGISElement<C,T>
-
- org.arakhne.afc.gis.primitive.AbstractBoundedGISElement<C,T>
-
- Type Parameters:
C
- is the type of the container of this element.T
- is the type of this element, used by the cloning feature.
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,AttributeChangeListener
,AttributeCollection
,AttributeProvider
,BoundedGISElement
,GISCloneable<T>
,GISElement
,GISPrimitive
,BoundedElement2afp<Rectangle2d>
,JsonableObject
- Direct Known Subclasses:
AbstractBusPrimitive
,MapElement
,MapLayer
,StandardRoadNetwork
public abstract class AbstractBoundedGISElement<C extends GISContainer<?>,T extends AbstractBoundedGISElement<C,T>> extends AbstractGISElement<C,T> implements BoundedGISElement
Element of a GIS application which is bounded.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:53
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- giscore
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.gis.primitive.AbstractGISElement
attributeSource, mapContainer
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISElement
ATTR_NAME, NAME_COMPARATOR
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description AbstractBoundedGISElement(UUID id, AttributeCollection attributeSource)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Rectangle2d
calcBounds()
Compute the bounds of this element.T
clone()
Clone this object to obtain a valid copy.Rectangle2d
getBoundingBox()
Replies the bounding box of this element.void
resetBoundingBox()
Clear the current bounding box to force the computation of it at the next call toBoundedElement2afp.getBoundingBox()
.protected void
setBoundingBox(Rectangle2d bounds)
Set the bounding box of this element.void
toJson(JsonBuffer buffer)
Replies the Json representation of this node.-
Methods inherited from class org.arakhne.afc.gis.primitive.AbstractGISElement
addAttributeChangeListener, addAttributes, addAttributes, attributes, copyAttributes, flush, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCollection, getAttributeCount, getAttributeObject, getAttributeProvider, getContainer, getGeoId, getName, getTopContainer, getUUID, hasAttribute, hashKey, isEventFirable, onAttributeChangeEvent, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setContainer, setEventFirable, setName, setUUID, toMap, toMap, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeCollection
addAttributeChangeListener, addAttributes, addAttributes, flush, isEventFirable, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setEventFirable
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
attributes, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCount, getAttributeObject, hasAttribute, toMap, toMap
-
Methods inherited from interface org.arakhne.afc.gis.primitive.BoundedGISElement
getShape
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISElement
copyAttributes, getName, hashKey, setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
getGeoId, getGeoLocation, getUUID
-
-
-
-
Constructor Detail
-
AbstractBoundedGISElement
public AbstractBoundedGISElement(UUID id, AttributeCollection attributeSource)
Constructor.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.attributeSource
- is the source of the attributes for this map element.- Since:
- 4.0
-
-
Method Detail
-
toJson
@Pure public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObject
Replies the Json representation of this node.- Specified by:
toJson
in interfaceJsonableObject
- Overrides:
toJson
in classAbstractGISElement<C extends GISContainer<?>,T extends AbstractBoundedGISElement<C,T>>
- Parameters:
buffer
- the Json buffer.
-
clone
@Pure public T clone()
Clone this object to obtain a valid copy.- Specified by:
clone
in interfaceAttributeCollection
- Specified by:
clone
in interfaceAttributeProvider
- Specified by:
clone
in interfaceGISCloneable<C extends GISContainer<?>>
- Specified by:
clone
in interfaceGISElement
- Overrides:
clone
in classAbstractGISElement<C extends GISContainer<?>,T extends AbstractBoundedGISElement<C,T>>
- Returns:
- a copy
-
getBoundingBox
@Pure public Rectangle2d getBoundingBox()
Description copied from interface:BoundedElement2afp
Replies the bounding box of this element.- Specified by:
getBoundingBox
in interfaceBoundedElement2afp<C extends GISContainer<?>>
- Returns:
- the bounding box or
null
if not applicable.
-
resetBoundingBox
public void resetBoundingBox()
Description copied from interface:BoundedGISElement
Clear the current bounding box to force the computation of it at the next call toBoundedElement2afp.getBoundingBox()
.- Specified by:
resetBoundingBox
in interfaceBoundedGISElement
-
setBoundingBox
protected void setBoundingBox(Rectangle2d bounds)
Set the bounding box of this element. This function does not check if the given bounds are enclosing the content of this element.- Parameters:
bounds
- is the bounds to combine with the bounds of this element.
-
calcBounds
@Pure protected abstract Rectangle2d calcBounds()
Compute the bounds of this element. This function does not update the internal attribute replied bygetBoundingBox()
- Returns:
- the bounds
-
-