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 Centroid
centroid
Centroid of the zoneprotected String
externalId
External Id for this zoneprotected org.locationtech.jts.geom.Polygon
geometry
geometry of this zoneprotected long
id
Unique identifier for the zoneprotected Map<String,Object>
inputProperties
generic input property storageprotected String
xmlId
xml 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 void
addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available membersprotected static long
generateZoneId(IdGroupingToken groupId)
Generate unique id for this zoneCentroid
getCentroid()
Returns the centroid of this zoneString
getExternalId()
get external id of the entityorg.locationtech.jts.geom.Polygon
getGeometry()
Collect the geometry (outer border) of this zonelong
getId()
Returns the id of this zoneObject
getInputProperty(String key)
Get input property by its keyString
getXmlId()
the id exposed to users as the "normal" id in the PLANit native xml formatvoid
setExternalId(String externalId)
set the external idvoid
setGeometry(org.locationtech.jts.geom.Polygon geometry)
set the geometry (outer border) of this zonevoid
setXmlId(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:
getCentroid
in interfaceZone
- Returns:
- centroid of this zone
-
getExternalId
public String getExternalId()
get external id of the entity- Specified by:
getExternalId
in interfaceExternalIdable
- Returns:
- external id
-
setExternalId
public void setExternalId(String externalId)
set the external id- Specified by:
setExternalId
in 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:
getXmlId
in interfaceExternalIdable
- Returns:
- xmlId
-
setXmlId
public void setXmlId(String xmlId)
set the external id- Specified by:
setXmlId
in 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:
setGeometry
in interfaceZone
- Parameters:
geometry
- of the zone
-
getGeometry
public org.locationtech.jts.geom.Polygon getGeometry()
Collect the geometry (outer border) of this zone- Specified by:
getGeometry
in interfaceZone
- Returns:
- geometry of the zone
-
-