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 Rectangle2dcalcBounds()Compute the bounds of this element.Tclone()Clone this object to obtain a valid copy.Rectangle2dgetBoundingBox()Replies the bounding box of this element.voidresetBoundingBox()Clear the current bounding box to force the computation of it at the next call toBoundedElement2afp.getBoundingBox().protected voidsetBoundingBox(Rectangle2d bounds)Set the bounding box of this element.voidtoJson(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, ornullif 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:JsonableObjectReplies the Json representation of this node.- Specified by:
toJsonin interfaceJsonableObject- Overrides:
toJsonin 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:
clonein interfaceAttributeCollection- Specified by:
clonein interfaceAttributeProvider- Specified by:
clonein interfaceGISCloneable<C extends GISContainer<?>>- Specified by:
clonein interfaceGISElement- Overrides:
clonein classAbstractGISElement<C extends GISContainer<?>,T extends AbstractBoundedGISElement<C,T>>- Returns:
- a copy
-
getBoundingBox
@Pure public Rectangle2d getBoundingBox()
Description copied from interface:BoundedElement2afpReplies the bounding box of this element.- Specified by:
getBoundingBoxin interfaceBoundedElement2afp<C extends GISContainer<?>>- Returns:
- the bounding box or
nullif not applicable.
-
resetBoundingBox
public void resetBoundingBox()
Description copied from interface:BoundedGISElementClear the current bounding box to force the computation of it at the next call toBoundedElement2afp.getBoundingBox().- Specified by:
resetBoundingBoxin 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
-
-