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 CentroidcentroidCentroid of the zoneprotected org.locationtech.jts.geom.Geometrygeometrygeometry of this zoneprotected Map<String,Object>inputPropertiesgeneric input property storageprotected Stringnamename 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 voidaddInputProperty(String key, Object value)Add a property from the original input that is not part of the readily available membersabstract ZoneImplclone()Create a shallow copy of this entityprotected static longgenerateZoneId(IdGroupingToken groupId)Generate unique id for this zoneCentroidgetCentroid()Returns the centroid of this zoneorg.locationtech.jts.geom.GeometrygetGeometry()Collect the geometry (outer border) of this zoneObjectgetInputProperty(String key)collect a propertyStringgetName()Name of the zonelongrecreateManagedIds(IdGroupingToken tokenId)recreate the internal id(s) and set them including the Idable idprotected voidsetCentroid(Centroid centroid)set the centroid for this zone.voidsetGeometry(org.locationtech.jts.geom.Geometry geometry)set the geometry (outer border) of this zone, can be a polygon, but also a line stringprotected voidsetId(long id)set the zone's unique internal id across all zonesvoidsetName(String name)Name of the zoneStringtoString()-
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:
setIdin classIdAbleImpl- Parameters:
id- to set
-
getCentroid
public Centroid getCentroid()
Returns the centroid of this zone- Specified by:
getCentroidin 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:
setGeometryin interfaceZone- Parameters:
geometry- of the zone
-
getGeometry
public org.locationtech.jts.geom.Geometry getGeometry()
Collect the geometry (outer border) of this zone- Specified by:
getGeometryin 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:
addInputPropertyin 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:
getInputPropertyin 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:
recreateManagedIdsin interfaceManagedId- Parameters:
tokenId- to use- Returns:
- the updated internal id
-
clone
public abstract ZoneImpl clone()
Create a shallow copy of this entity
-
-