Package org.goplanit.utils.network.layer
Interface TransportLayer
-
- All Superinterfaces:
Cloneable
,Comparable<IdAble>
,ExternalIdAble
,IdAble
,ManagedId
- All Known Subinterfaces:
MacroscopicNetworkLayer
,PhysicalLayer
,ServiceNetworkLayer
,TopologicalLayer
,UntypedDirectedGraphLayer<V,E,S>
,UntypedPhysicalLayer<N,L,LS>
- All Known Implementing Classes:
MacroscopicNetworkLayerImpl
,ServiceNetworkLayerImpl
,TopologicalLayerImpl
,TransportLayerImpl
,UntypedNetworkLayerImpl
,UntypedPhysicalLayerImpl
public interface TransportLayer extends ExternalIdAble, ManagedId
An infrastructure layer represents the infrastructure suited for a number of modes. This can be in the form of a physical network or by some other (more aggregate) representation. The combination of infrastructure layers can be used to construct an intermodal network. Each layer supports one or more modes- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static Class<TransportLayer>
TRANSPORT_LAYER_ID_CLASS
class used for managed id generation
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static String
createLayerLogPrefix(TransportLayer layer)
create a string that can be used to prefix log statements for this layer to - in a unified way - identify this statement came from a particular layerdefault Mode
getFirstSupportedMode()
Collect the first mode found under the supported modes from the collection provided by getSupportedModesdefault Class<TransportLayer>
getIdClass()
Each managed id class is expected to generate its ids based on its class signature.Collection<Mode>
getSupportedModes()
collect the modes supported by this infrastructure layerdefault boolean
hasSupportedModes()
Determine if layer contains any supported modesboolean
isEmpty()
check if the layer is empty of any infrastructurevoid
logInfo(String prefix)
invoked by entities inquiring about general information about the layer to display to usersboolean
registerSupportedMode(Mode supportedMode)
register a mode as supported by this layerboolean
registerSupportedModes(Collection<Mode> supportedModes)
register modes as supported by this layervoid
reset()
Reset the layerdefault boolean
supports(Mode mode)
Determine if mode is supported by this layerboolean
validate()
validate the infrastructure of this layer-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
clone, compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
recreateManagedIds, resetChildManagedIdEntities
-
-
-
-
Field Detail
-
TRANSPORT_LAYER_ID_CLASS
static final Class<TransportLayer> TRANSPORT_LAYER_ID_CLASS
class used for managed id generation
-
-
Method Detail
-
getIdClass
default Class<TransportLayer> getIdClass()
Each managed id class is expected to generate its ids based on its class signature. To be able to generate the correct id the class used for id generation is to be provided via this method call.- Specified by:
getIdClass
in interfaceManagedId
- Returns:
- idClass to use for generating ids for instances of this idable derived class
-
createLayerLogPrefix
static String createLayerLogPrefix(TransportLayer layer)
create a string that can be used to prefix log statements for this layer to - in a unified way - identify this statement came from a particular layer- Parameters:
layer
- to use- Returns:
- String "[layer: xmlID ]"
-
registerSupportedMode
boolean registerSupportedMode(Mode supportedMode)
register a mode as supported by this layer- Parameters:
supportedMode
- to support- Returns:
- true when successful false otherwise
-
registerSupportedModes
boolean registerSupportedModes(Collection<Mode> supportedModes)
register modes as supported by this layer- Parameters:
supportedModes
- to support- Returns:
- true when successful false otherwise
-
getSupportedModes
Collection<Mode> getSupportedModes()
collect the modes supported by this infrastructure layer- Returns:
- the supported modes for at least some part of the available infrastructure
-
isEmpty
boolean isEmpty()
check if the layer is empty of any infrastructure- Returns:
- true when empty, false otherwise
-
logInfo
void logInfo(String prefix)
invoked by entities inquiring about general information about the layer to display to users- Parameters:
prefix
- optional prefix to include in each line of logging
-
validate
boolean validate()
validate the infrastructure of this layer- Returns:
- true when valid, false otherwise
-
supports
default boolean supports(Mode mode)
Determine if mode is supported by this layer- Parameters:
mode
- to verify- Returns:
- true when supporting, false otherwise
-
hasSupportedModes
default boolean hasSupportedModes()
Determine if layer contains any supported modes- Returns:
- true when supporting a mode, false otherwise
-
getFirstSupportedMode
default Mode getFirstSupportedMode()
Collect the first mode found under the supported modes from the collection provided by getSupportedModes- Returns:
- first supported mode
-
reset
void reset()
Reset the layer
-
-