Package org.planit.zoning
Class ZoneImpl
- java.lang.Object
-
- org.planit.zoning.ZoneImpl
-
- All Implemented Interfaces:
Comparable<Idable>,ExternalIdable,Idable,Zone
- Direct Known Subclasses:
OdZoneImpl,TransferZoneImpl
public class ZoneImpl extends Object implements Zone
Represents a demand generating zone in the network.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected CentroidcentroidCentroid of the zoneprotected StringexternalIdExternal Id for this zoneprotected org.locationtech.jts.geom.Polygongeometrygeometry of this zoneprotected longidUnique identifier for the zoneprotected Map<String,Object>inputPropertiesgeneric input property storageprotected StringxmlIdxml Id for this zone
-
Constructor Summary
Constructors Constructor Description ZoneImpl(IdGroupingToken tokenId)Constructor
-
Method Summary
All Methods Static Methods Instance 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 membersprotected static longgenerateZoneId(IdGroupingToken groupId)Generate unique id for this zoneCentroidgetCentroid()Returns the centroid of this zoneStringgetExternalId()get external id of the entityorg.locationtech.jts.geom.PolygongetGeometry()Collect the geometry (outer border) of this zonelonggetId()Returns the id of this zoneObjectgetInputProperty(String key)Get input property by its keyStringgetXmlId()the id exposed to users as the "normal" id in the PLANit native xml formatvoidsetExternalId(String externalId)set the external idvoidsetGeometry(org.locationtech.jts.geom.Polygon geometry)set the geometry (outer border) of this zonevoidsetXmlId(String xmlId)set the external id-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.planit.utils.id.ExternalIdable
hasExternalId, hasXmlId
-
Methods inherited from interface org.planit.utils.id.Idable
compareTo, idEquals, idHashCode
-
-
-
-
Field Detail
-
id
protected final long id
Unique identifier for the zone
-
externalId
protected String externalId
External Id for this zone
-
xmlId
protected String xmlId
xml Id for this zone
-
centroid
protected final Centroid centroid
Centroid of the zone
-
geometry
protected org.locationtech.jts.geom.Polygon geometry
geometry of this zone
-
-
Constructor Detail
-
ZoneImpl
public ZoneImpl(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId- contiguous id generation within this group for instances of this class
-
-
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
-
getId
public long getId()
Returns the id of this 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- Parameters:
key- property keyvalue- property value
-
getInputProperty
public Object getInputProperty(String key)
Get input property by its key- Parameters:
key- property key- Returns:
- property value
-
getCentroid
public Centroid getCentroid()
Returns the centroid of this zone- Specified by:
getCentroidin interfaceZone- Returns:
- centroid of this zone
-
getExternalId
public String getExternalId()
get external id of the entity- Specified by:
getExternalIdin interfaceExternalIdable- Returns:
- external id
-
setExternalId
public void setExternalId(String externalId)
set the external id- Specified by:
setExternalIdin interfaceExternalIdable- Parameters:
externalId- to set
-
getXmlId
public String getXmlId()
the id exposed to users as the "normal" id in the PLANit native xml format- Specified by:
getXmlIdin interfaceExternalIdable- Returns:
- xmlId
-
setXmlId
public void setXmlId(String xmlId)
set the external id- Specified by:
setXmlIdin interfaceExternalIdable- Parameters:
xmlId- to set
-
setGeometry
public void setGeometry(org.locationtech.jts.geom.Polygon geometry)
set the geometry (outer border) of this zone- Specified by:
setGeometryin interfaceZone- Parameters:
geometry- of the zone
-
getGeometry
public org.locationtech.jts.geom.Polygon getGeometry()
Collect the geometry (outer border) of this zone- Specified by:
getGeometryin interfaceZone- Returns:
- geometry of the zone
-
-