Package org.goplanit.utils.zoning
Interface Zone
-
- All Superinterfaces:
Comparable<IdAble>
,ExternalIdAble
,IdAble
,ManagedId
- All Known Subinterfaces:
OdZone
,TransferZone
- All Known Implementing Classes:
OdZoneImpl
,TransferZoneImpl
,ZoneImpl
public interface Zone extends ExternalIdAble, ManagedId
Zone represent a geographical area with a centroid which in turn represent the single point of departure of all traffic in the zone- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static Logger
LOGGER
the loggerstatic Class<Zone>
ZONE_ID_CLASS
the class to use for the id generation
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available membersZone
deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call.Centroid
getCentroid()
Returns the centroid of this zonedefault org.locationtech.jts.geom.Envelope
getEnvelope()
collect the envelope (bounding box) of this zone's geometry.org.locationtech.jts.geom.Geometry
getGeometry()
Collect the geometry (outer border) of this zonedefault org.locationtech.jts.geom.Geometry
getGeometry(boolean considerCentroid)
Collect the geometry of this zone and allow it to return its internal centroid location in case it has no geometry of its own by means of provided flag.default Class<Zone>
getIdClass()
Each managed id class is expected to generate its ids based on its class signature.Object
getInputProperty(String key)
collect a propertyString
getName()
Name of the zonedefault boolean
hasCentroid()
verify if centroid is presentdefault boolean
hasGeometry()
verify if the zone has a geometrydefault boolean
hasInputProperty(String key)
Verify if input property existsdefault boolean
hasName()
Verify if a name has been setvoid
setGeometry(org.locationtech.jts.geom.Geometry geometry)
set the geometry (outer border) of this zone, can be a polygon, but also a line stringvoid
setName(String name)
Name of the zoneZone
shallowClone()
Create a shallow copy of this entity-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
recreateManagedIds, resetChildManagedIdEntities
-
-
-
-
Method Detail
-
addInputProperty
void addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available members- Parameters:
key
- key (name) of the input propertyvalue
- value of the input property
-
getInputProperty
Object getInputProperty(String key)
collect a property- Parameters:
key
- for the property- Returns:
- property itself
-
getCentroid
Centroid getCentroid()
Returns the centroid of this zone- Returns:
- centroid of this zone
-
setGeometry
void setGeometry(org.locationtech.jts.geom.Geometry geometry)
set the geometry (outer border) of this zone, can be a polygon, but also a line string- Parameters:
geometry
- of the zone
-
getGeometry
org.locationtech.jts.geom.Geometry getGeometry()
Collect the geometry (outer border) of this zone- Returns:
- geometry of the zone
-
getGeometry
default org.locationtech.jts.geom.Geometry getGeometry(boolean considerCentroid)
Collect the geometry of this zone and allow it to return its internal centroid location in case it has no geometry of its own by means of provided flag.- Parameters:
considerCentroid
- when false centroid geometry is ignored, when true it is returned in case no explicit geoemetry is set- Returns:
- geometry of the zone
-
setName
void setName(String name)
Name of the zone- Parameters:
name
- of the zone
-
getName
String getName()
Name of the zone- Returns:
- name of the zone
-
shallowClone
Zone shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Returns:
- shallow copy of entity
-
deepClone
Zone deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
-
getIdClass
default Class<Zone> getIdClass()
Each managed id class is expected to generate its ids based on its class signature. To be able to generate the correct id the class used for id generation is to be provided via this method call.- Specified by:
getIdClass
in interfaceManagedId
- Returns:
- idClass to use for generating ids for instances of this idable derived class
-
hasGeometry
default boolean hasGeometry()
verify if the zone has a geometry- Returns:
- true if available, false otherwise
-
hasCentroid
default boolean hasCentroid()
verify if centroid is present- Returns:
- true when present, false otherwise
-
hasName
default boolean hasName()
Verify if a name has been set- Returns:
- true when present, false otherwise
-
hasInputProperty
default boolean hasInputProperty(String key)
Verify if input property exists- Parameters:
key
- to check- Returns:
- truw when present, false otherwise
-
getEnvelope
default org.locationtech.jts.geom.Envelope getEnvelope()
collect the envelope (bounding box) of this zone's geometry. In case, the zone has no geometry we revert to using the geometry (location) of its centroid.- Returns:
- envelope of the zone
-
-