Package org.planit.network.virtual
Class ZoneImpl
- java.lang.Object
-
- org.planit.network.virtual.ZoneImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected CentroidcentroidCentroid of the zoneprotected ObjectexternalIdExternal Id for this zoneprotected longidUnique identifier for the zoneprotected Map<String,Object>inputPropertiesgeneric 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 voidaddInputProperty(String key, Object value)Add a property from the original input that is not part of the readily available membersprotected static intgenerateZoneId(IdGroupingToken groupId)Generate unique id for this zoneCentroidgetCentroid()Returns the centroid of this zoneObjectgetExternalId()Returns the external id of this zonelonggetId()Returns the id of this zoneObjectgetInputProperty(String key)Get input property by its keybooleanhasExternalId()Returns whether this zone has its external Id setvoidsetCentroid(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:
getCentroidin 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:ZoneReturns the external id of this zone- Specified by:
getExternalIdin interfaceZone- Returns:
- the external id
-
hasExternalId
public boolean hasExternalId()
Description copied from interface:ZoneReturns whether this zone has its external Id set- Specified by:
hasExternalIdin interfaceZone- Returns:
- true if the external id has been set, false otherwise
-
-