Package org.goplanit.zoning
Class ZoneImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.zoning.ZoneImpl
-
- All Implemented Interfaces:
Cloneable
,Comparable<IdAble>
,ExternalIdAble
,IdAble
,ManagedId
,Zone
- Direct Known Subclasses:
OdZoneImpl
,TransferZoneImpl
public abstract class ZoneImpl extends ExternalIdAbleImpl implements Zone
Represents a zone base class.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Centroid
centroid
Centroid of the zoneprotected org.locationtech.jts.geom.Geometry
geometry
geometry of this zoneprotected Map<String,Object>
inputProperties
generic input property storageprotected String
name
name of the zone-
Fields inherited from interface org.goplanit.utils.zoning.Zone
LOGGER, ZONE_ID_CLASS
-
-
Constructor Summary
Constructors Constructor Description ZoneImpl(IdGroupingToken tokenId)
ConstructorZoneImpl(ZoneImpl other)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete 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 membersabstract ZoneImpl
clone()
Create a shallow copy of this entityprotected static long
generateZoneId(IdGroupingToken groupId)
Generate unique id for this zoneCentroid
getCentroid()
Returns the centroid of this zoneorg.locationtech.jts.geom.Geometry
getGeometry()
Collect the geometry (outer border) of this zoneObject
getInputProperty(String key)
collect a propertyString
getName()
Name of the zonelong
recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable idprotected void
setCentroid(Centroid centroid)
set the centroid for this zone.void
setGeometry(org.locationtech.jts.geom.Geometry geometry)
set the geometry (outer border) of this zone, can be a polygon, but also a line stringprotected void
setId(long id)
set the zone's unique internal id across all zonesvoid
setName(String name)
Name of the zoneString
toString()
-
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
resetChildManagedIdEntities
-
Methods inherited from interface org.goplanit.utils.zoning.Zone
getEnvelope, getIdClass, hasCentroid, hasGeometry, hasInputProperty, hasName
-
-
-
-
Constructor Detail
-
ZoneImpl
public ZoneImpl(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId
- contiguous id generation within this group for instances of this class
-
ZoneImpl
public ZoneImpl(ZoneImpl other)
Constructor- Parameters:
other
- to copy
-
-
Method Detail
-
generateZoneId
protected static long generateZoneId(IdGroupingToken groupId)
Generate unique id for this zone- Parameters:
groupId
- contiguous id generation within this group for instances of this class- Returns:
- id for this zone
-
setCentroid
protected void setCentroid(Centroid centroid)
set the centroid for this zone. It is assumed the centroid is correctly configured to be compatible with this zoneImpl- Parameters:
centroid
- to set
-
setId
protected void setId(long id)
set the zone's unique internal id across all zones- Overrides:
setId
in classIdAbleImpl
- Parameters:
id
- to set
-
getCentroid
public Centroid getCentroid()
Returns the centroid of this zone- Specified by:
getCentroid
in interfaceZone
- Returns:
- centroid of this zone
-
setGeometry
public 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- Specified by:
setGeometry
in interfaceZone
- Parameters:
geometry
- of the zone
-
getGeometry
public org.locationtech.jts.geom.Geometry getGeometry()
Collect the geometry (outer border) of this zone- Specified by:
getGeometry
in interfaceZone
- Returns:
- geometry of the zone
-
getName
public String getName()
Name of the zone
-
setName
public void setName(String name)
Name of the zone
-
addInputProperty
public void addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available members- Specified by:
addInputProperty
in interfaceZone
- Parameters:
key
- key (name) of the input propertyvalue
- value of the input property
-
getInputProperty
public Object getInputProperty(String key)
collect a property- Specified by:
getInputProperty
in interfaceZone
- Parameters:
key
- for the property- Returns:
- property itself
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable id- Specified by:
recreateManagedIds
in interfaceManagedId
- Parameters:
tokenId
- to use- Returns:
- the updated internal id
-
clone
public abstract ZoneImpl clone()
Create a shallow copy of this entity
-
-