Interface NetworkLayers<T extends NetworkLayer>
-
- All Superinterfaces:
Iterable<T>,LongMapWrapper<T>,ManagedIdEntities<T>,MapWrapper<Long,T>
- All Known Subinterfaces:
MacroscopicNetworkLayers,ServiceNetworkLayers,TopologicalLayers<T>,UntypedDirectedGraphLayers<L>,UntypedPhysicalNetworkLayers<L>
- All Known Implementing Classes:
MacroscopicNetworkLayersImpl,ServiceNetworkLayersImpl,TopologicalLayersImpl,TransportLayersImpl,UntypedPhysicalNetworkLayersImpl
public interface NetworkLayers<T extends NetworkLayer> extends ManagedIdEntities<T>
interface to manage transport layers.- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description NetworkLayers<T>deepClone()Deep clone implementationNetworkLayers<T>deepCloneWithMapping(BiConsumer<T,T> mapper)Deep clone implementation where the mapping for its internal copies is captured by the provided mapperTget(Mode mode)Find the layer that supports the passed in mode.default Tget(PredefinedModeType predefinedModeType)Find layer that supports the given predefined mode type (not custom mode type)TgetByXmlId(String xmlId)Find the layer based on non-indexed XML id rather than the managed internal id.default <U extends NetworkLayer>
Collection<U>getLayersOfType()Allows you to collect all registered layers of a specific derived transport layer typedefault Collection<Mode>getSupportedModes()Collect all distinct supported modes across all network layers in newly created collectiondefault booleanisEachLayerEmpty()Check if each layer itself is emptyNetworkLayers<T>shallowClone()Shallow clone implementation-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.wrapper.LongMapWrapper
get, remove
-
Methods inherited from interface org.goplanit.utils.id.ManagedIdEntities
containsKey, getFactory, getManagedIdClass, groupBy, recreateIds, recreateIds, reset, streamSortedBy
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, containsValue, firstMatch, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, removeAll, removeIf, size, stream, streamSorted, toCollection, toMap, valuesAsNewSet
-
-
-
-
Method Detail
-
get
T get(Mode mode)
Find the layer that supports the passed in mode. Since a mode is only allowed to be supported by a single layer, this should yield the correct result. If multiple layers support the same mode for some reason, this method returns the first layer that supports the mode- Parameters:
mode- to find the layer for- Returns:
- first matching layer
-
getByXmlId
T getByXmlId(String xmlId)
Find the layer based on non-indexed XML id rather than the managed internal id.- Parameters:
xmlId- to find the layer for- Returns:
- first matching layer
-
isEachLayerEmpty
default boolean isEachLayerEmpty()
Check if each layer itself is empty- Returns:
- true when all empty false otherwise
-
getLayersOfType
default <U extends NetworkLayer> Collection<U> getLayersOfType()
Allows you to collect all registered layers of a specific derived transport layer type- Type Parameters:
U- derived type of type T- Returns:
- list of layers of desired type, empty list when none exist
-
getSupportedModes
default Collection<Mode> getSupportedModes()
Collect all distinct supported modes across all network layers in newly created collection- Returns:
- supported modes
-
shallowClone
NetworkLayers<T> shallowClone()
Shallow clone implementation- Specified by:
shallowClonein interfaceManagedIdEntities<T extends NetworkLayer>- Specified by:
shallowClonein interfaceMapWrapper<Long,T extends NetworkLayer>- Returns:
- clone of entities
-
deepClone
NetworkLayers<T> deepClone()
Deep clone implementation- Specified by:
deepClonein interfaceManagedIdEntities<T extends NetworkLayer>- Returns:
- deep copy of entities
-
deepCloneWithMapping
NetworkLayers<T> deepCloneWithMapping(BiConsumer<T,T> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMappingin interfaceManagedIdEntities<T extends NetworkLayer>- Parameters:
mapper- to apply to each mapping between original and copy- Returns:
- copy
-
get
default T get(PredefinedModeType predefinedModeType)
Find layer that supports the given predefined mode type (not custom mode type)- Parameters:
predefinedModeType- to check for- Returns:
- found layers
-
-