Package org.planit.network.virtual
Class ZoneImpl
- java.lang.Object
-
- org.planit.network.virtual.ZoneImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected Centroid
centroid
Centroid of the zoneprotected Object
externalId
External Id for this zoneprotected long
id
Unique identifier for the zoneprotected Map<String,Object>
inputProperties
generic input property storage
-
Constructor Summary
Constructors Constructor Description ZoneImpl(IdGroupingToken groupId, Object externalId)
ConstructorZoneImpl(IdGroupingToken groupId, Object externalId, Centroid centroid)
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 int
generateZoneId(IdGroupingToken groupId)
Generate unique id for this zoneCentroid
getCentroid()
Returns the centroid of this zoneObject
getExternalId()
Returns the external id of this zonelong
getId()
Returns the id of this zoneObject
getInputProperty(String key)
Get input property by its keyboolean
hasExternalId()
Returns whether this zone has its external Id setvoid
setCentroid(Centroid centroid)
Set the centroid of this zone
-
-
-
Constructor Detail
-
ZoneImpl
public ZoneImpl(IdGroupingToken groupId, Object externalId, Centroid centroid)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this classexternalId
- the external ID of this zonecentroid
- of the zone
-
ZoneImpl
public ZoneImpl(IdGroupingToken groupId, Object externalId)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this classexternalId
- the external ID of this zone
-
-
Method Detail
-
generateZoneId
protected static int 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
-
setCentroid
public void setCentroid(Centroid centroid)
Set the centroid of this zone- Parameters:
centroid
- centroid for this zone
-
getExternalId
public Object getExternalId()
Description copied from interface:Zone
Returns the external id of this zone- Specified by:
getExternalId
in interfaceZone
- Returns:
- the external id
-
hasExternalId
public boolean hasExternalId()
Description copied from interface:Zone
Returns whether this zone has its external Id set- Specified by:
hasExternalId
in interfaceZone
- Returns:
- true if the external id has been set, false otherwise
-
-