Class LayeredNetwork<U extends NetworkLayer,​T extends NetworkLayers<U>>

  • Type Parameters:
    U - transport layer base class
    T - transport layer container class where each layer extends <U>
    All Implemented Interfaces:
    Serializable, Comparable<IdAble>, EventListener, PlanitComponentListener, EventListener, ExternalIdAble, IdAble
    Direct Known Subclasses:
    TopologicalLayerNetwork

    public abstract class LayeredNetwork<U extends NetworkLayer,​T extends NetworkLayers<U>>
    extends Network
    A transport network with one or more layers. One can choose the container for the different layers as a generic type that defines the container level operations available. Each container has a certain base class for the TransportLayer entities which is the second generic type. This allows one to have a base class for each layer, while the layer itself can derive from this base level. This way the user has maximum flexibility regarding what the functionality and properties of each layer are and how they are exposed via the container
    Author:
    markr
    See Also:
    Serialized Form
    • Constructor Detail

      • LayeredNetwork

        public LayeredNetwork​(IdGroupingToken tokenId)
        Default constructor
        Parameters:
        tokenId - to use for id generation
      • LayeredNetwork

        protected LayeredNetwork​(LayeredNetwork<U,​T> other,
                                 boolean deepCopy,
                                 ManagedIdDeepCopyMapper<Mode> modeMapper,
                                 ManagedIdDeepCopyMapper<U> layerMapper)
        Copy constructor.
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
        modeMapper - to use for tracking mapping between original and copied modes
        layerMapper - to use for tracking mapping between original and copied layers
    • Method Detail

      • createLayersContainer

        protected abstract T createLayersContainer​(IdGroupingToken networkIdToken)
        Derived type is to provide the actual layer implementations
        Parameters:
        networkIdToken - to use
        Returns:
        infrastructure layers container
      • getLayerByMode

        public U getLayerByMode​(Mode mode)
        collect a layer by mode
        Parameters:
        mode - to collect layer for
        Returns:
        corresponding layer, (null if not found)
      • getLayerByPredefinedModeType

        public U getLayerByPredefinedModeType​(PredefinedModeType predefinedModeType)
        collect a layer by predefined mode type (we exclude custom mode types)
        Parameters:
        predefinedModeType - to collect layer for
        Returns:
        corresponding layer, (null if not found)
      • getModes

        public Modes getModes()
        Collect the modes
        Returns:
        modes container
      • getTransportLayers

        public T getTransportLayers()
        Collect the transport layers
        Returns:
        transport layers container
      • reset

        public void reset()
        All components should be able to reset going back to some representative initial state
        Overrides:
        reset in class Network
      • isEmpty

        public boolean isEmpty()
        Empty when all layers in the layers container are empty
        Specified by:
        isEmpty in class Network
        Returns:
        true when empty, false otherwise
      • deepClone

        public abstract LayeredNetwork deepClone()
        deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in class Network
        Returns:
        deep copy of entity