Package org.goplanit.utils.network.layer
Interface NetworkLayer
-
- All Superinterfaces:
Comparable<IdAble>,ExternalIdAble,IdAble,ManagedId
- All Known Subinterfaces:
ConjugateMacroscopicNetworkLayer,MacroscopicNetworkLayer,PhysicalLayer,ServiceNetworkLayer,TopologicalLayer,UntypedDirectedGraphLayer<V,E,S>,UntypedPhysicalLayer<N,L,LS>
- All Known Implementing Classes:
ConjugateMacroscopicNetworkLayerImpl,MacroscopicNetworkLayerImpl,NetworkLayerImpl,ServiceNetworkLayerImpl,TopologicalLayerImpl,UntypedNetworkLayerImpl,UntypedPhysicalLayerImpl
public interface NetworkLayer extends ExternalIdAble, ManagedId
A network 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<NetworkLayer>NETWORK_LAYER_ID_CLASSclass used for managed id generation
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static StringcreateLayerLogPrefix(NetworkLayer 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 layerNetworkLayerdeepClone()A network layer deep clone is expected to update interdependencies between "owned" deep cloned entities where possibledefault ModegetFirstSupportedMode()Collect the first mode found under the supported modes from the collection provided by getSupportedModesdefault Class<NetworkLayer>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 booleanhasSupportedModes()Determine if layer contains any supported modesbooleanisEmpty()check if the layer is empty of any infrastructurevoidlogInfo(String prefix)invoked by entities inquiring about general information about the layer to display to usersbooleanregisterSupportedMode(Mode supportedMode)register a mode as supported by this layerbooleanregisterSupportedModes(Collection<Mode> supportedModes)register modes as supported by this layervoidreset()Reset the layerNetworkLayershallowClone()Create a shallow copy of this entitydefault booleansupports(Mode mode)Determine if mode is supported by this layerdefault booleansupports(PredefinedModeType modeType)Determine if mode is supported by this layerbooleansupportsPredefinedMode(PredefinedModeType predefinedModeType)Verify if a predefined mode is supported based on its typebooleanvalidate()validate the infrastructure of this layer-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
recreateManagedIds, resetChildManagedIdEntities
-
-
-
-
Field Detail
-
NETWORK_LAYER_ID_CLASS
static final Class<NetworkLayer> NETWORK_LAYER_ID_CLASS
class used for managed id generation
-
-
Method Detail
-
getIdClass
default Class<NetworkLayer> 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:
getIdClassin interfaceManagedId- Returns:
- idClass to use for generating ids for instances of this idable derived class
-
shallowClone
NetworkLayer shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceIdAble- Returns:
- shallow copy of entity
-
deepClone
NetworkLayer deepClone()
A network layer deep clone is expected to update interdependencies between "owned" deep cloned entities where possible
-
createLayerLogPrefix
static String createLayerLogPrefix(NetworkLayer 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
-
supportsPredefinedMode
boolean supportsPredefinedMode(PredefinedModeType predefinedModeType)
Verify if a predefined mode is supported based on its type- Parameters:
predefinedModeType- to verify- Returns:
- true, when supported, false otherwise
-
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
-
supports
default boolean supports(PredefinedModeType modeType)
Determine if mode is supported by this layer- Parameters:
modeType- 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
-
-