Package org.goplanit.network.layer
Class TransportLayerImpl
- java.lang.Object
- 
- org.goplanit.utils.id.IdAbleImpl
- 
- org.goplanit.utils.id.ExternalIdAbleImpl
- 
- org.goplanit.network.layer.TransportLayerImpl
 
 
 
- 
- All Implemented Interfaces:
- Cloneable,- Comparable<IdAble>,- ExternalIdAble,- IdAble,- ManagedId,- TransportLayer
 - Direct Known Subclasses:
- TopologicalLayerImpl
 
 public abstract class TransportLayerImpl extends ExternalIdAbleImpl implements TransportLayer Implementation of TransportLayer interface with only barebones functionality to support ids and modes. Only meant as starting point for actual implementations that built on it- Author:
- markr
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected Map<Long,Mode>supportedModesthe modes supported by this layer- 
Fields inherited from interface org.goplanit.utils.network.layer.TransportLayerTRANSPORT_LAYER_ID_CLASS
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedTransportLayerImpl(TransportLayerImpl transportLayerImpl)Copy constructorprotectedTransportLayerImpl(IdGroupingToken tokenId)Constructor
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TransportLayerImplclone()Create a shallow copy of this entityprotected static longgenerateId(IdGroupingToken tokenId)generate unique node idCollection<Mode>getSupportedModes()collect the modes supported by this infrastructure layervoidlogInfo(String prefix)invoked by entities inquiring about general information about the layer to display to userslongrecreateManagedIds(IdGroupingToken tokenId)recreate the internal id(s) and set them including the Idable idbooleanregisterSupportedMode(Mode supportedMode)register a mode as supported by this layerbooleanregisterSupportedModes(Collection<Mode> supportedModes)register modes as supported by this layervoidreset()Reset the layer- 
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImplgetExternalId, getXmlId, setExternalId, setXmlId
 - 
Methods inherited from class org.goplanit.utils.id.IdAbleImplequals, generateAndSetId, generateId, getId, hashCode, setId
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.goplanit.utils.id.ExternalIdAblegetExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
 - 
Methods inherited from interface org.goplanit.utils.id.IdAblecompareTo, getId, idEquals, idHashCode
 - 
Methods inherited from interface org.goplanit.utils.id.ManagedIdresetChildManagedIdEntities
 - 
Methods inherited from interface org.goplanit.utils.network.layer.TransportLayergetFirstSupportedMode, getIdClass, hasSupportedModes, isEmpty, supports, validate
 
- 
 
- 
- 
- 
Constructor Detail- 
TransportLayerImplprotected TransportLayerImpl(IdGroupingToken tokenId) Constructor- Parameters:
- tokenId- to generate id for this instance for
 
 - 
TransportLayerImplprotected TransportLayerImpl(TransportLayerImpl transportLayerImpl) Copy constructor- Parameters:
- transportLayerImpl- to copy
 
 
- 
 - 
Method Detail- 
generateIdprotected static long generateId(IdGroupingToken tokenId) generate unique node id- Parameters:
- tokenId- contiguous id generation within this group for instances of this class
- Returns:
- nodeId
 
 - 
registerSupportedModepublic boolean registerSupportedMode(Mode supportedMode) register a mode as supported by this layer- Specified by:
- registerSupportedModein interface- TransportLayer
- Parameters:
- supportedMode- to support
- Returns:
- true when successful false otherwise
 
 - 
registerSupportedModespublic boolean registerSupportedModes(Collection<Mode> supportedModes) register modes as supported by this layer- Specified by:
- registerSupportedModesin interface- TransportLayer
- Parameters:
- supportedModes- to support
- Returns:
- true when successful false otherwise
 
 - 
getSupportedModespublic Collection<Mode> getSupportedModes() collect the modes supported by this infrastructure layer- Specified by:
- getSupportedModesin interface- TransportLayer
- Returns:
- the supported modes for at least some part of the available infrastructure
 
 - 
logInfopublic void logInfo(String prefix) invoked by entities inquiring about general information about the layer to display to users- Specified by:
- logInfoin interface- TransportLayer
- Parameters:
- prefix- optional prefix to include in each line of logging
 
 - 
recreateManagedIdspublic long recreateManagedIds(IdGroupingToken tokenId) recreate the internal id(s) and set them including the Idable id- Specified by:
- recreateManagedIdsin interface- ManagedId
- Parameters:
- tokenId- to use
- Returns:
- the updated internal id
 
 - 
resetpublic void reset() Reset the layer- Specified by:
- resetin interface- TransportLayer
 
 - 
clonepublic abstract TransportLayerImpl clone() Create a shallow copy of this entity- Specified by:
- clonein interface- IdAble
- Overrides:
- clonein class- ExternalIdAbleImpl
- Returns:
- shallow copy of entity
 
 
- 
 
-