Package org.planit.network
Class InfrastructureLayerImpl
- java.lang.Object
-
- org.planit.network.InfrastructureLayerImpl
-
- All Implemented Interfaces:
Comparable<Idable>,InfrastructureLayer,ExternalIdable,Idable
- Direct Known Subclasses:
PhysicalNetwork
public abstract class InfrastructureLayerImpl extends Object implements InfrastructureLayer
Implementation of infrastructure layer interface with only barebones functionality to support ids and modes. Only meant as starting point for actual implementations- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected StringexternalIdexternal id for this infrastructure layer (if any)protected longidunique id for this infrastructure layerprotected Map<Long,Mode>supportedModesthe modes supported by this layerprotected StringxmlIdxml id for this infrastructure layer
-
Constructor Summary
Constructors Constructor Description InfrastructureLayerImpl(IdGroupingToken tokenId)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static longgenerateId(IdGroupingToken tokenId)generate unique node idStringgetExternalId()get external id of the entitylonggetId()collect id of the entityCollection<Mode>getSupportedModes()collect the modes supported by this infrastructure layerStringgetXmlId()the id exposed to users as the "normal" id in the PLANit native xml formatbooleanregisterSupportedMode(Mode supportedMode)register a mode as supported by this layerbooleanregisterSupportedModes(Collection<Mode> supportedModes)register modes as supported by this layervoidsetExternalId(String externalId)set the external idprotected voidsetId(Long id)Set id on vertexvoidsetXmlId(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
-
Methods inherited from interface org.planit.network.InfrastructureLayer
isEmpty, logInfo, removeDanglingSubnetworks, removeDanglingSubnetworks, supports, transform, validate
-
-
-
-
Constructor Detail
-
InfrastructureLayerImpl
public InfrastructureLayerImpl(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId- to generate id for this instance for
-
-
Method Detail
-
generateId
protected static long generateId(IdGroupingToken tokenId)
generate unique node id- Parameters:
tokenId- contiguous id generation within this group for instances of this class- Returns:
- nodeId
-
setId
protected void setId(Long id)
Set id on vertex- Parameters:
id- to set
-
registerSupportedMode
public boolean registerSupportedMode(Mode supportedMode)
register a mode as supported by this layer- Specified by:
registerSupportedModein interfaceInfrastructureLayer- Parameters:
supportedMode- to support- Returns:
- true when successful false otherwise
-
registerSupportedModes
public boolean registerSupportedModes(Collection<Mode> supportedModes)
register modes as supported by this layer- Specified by:
registerSupportedModesin interfaceInfrastructureLayer- Parameters:
supportedModes- to support- Returns:
- true when successful false otherwise
-
getId
public long getId()
collect id of the entity
-
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
-
getSupportedModes
public final Collection<Mode> getSupportedModes()
collect the modes supported by this infrastructure layer- Specified by:
getSupportedModesin interfaceInfrastructureLayer- Returns:
- the supported modes for at least some part of the available infrastructure
-
-