Package org.goplanit.network.layers
Class TransportLayersImpl<T extends TransportLayer>
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<T>
-
- org.goplanit.network.layers.TransportLayersImpl<T>
-
- All Implemented Interfaces:
Cloneable
,Iterable<T>
,ManagedIdEntities<T>
,TransportLayers<T>
,LongMapWrapper<T>
,MapWrapper<Long,T>
- Direct Known Subclasses:
TopologicalLayersImpl
public abstract class TransportLayersImpl<T extends TransportLayer> extends ManagedIdEntitiesImpl<T> implements TransportLayers<T>
Base implementation of the TransportLayer interface, without the createNew() method- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description TransportLayersImpl(TransportLayersImpl<T> other)
ConstructorTransportLayersImpl(IdGroupingToken idToken)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TransportLayersImpl<T>
clone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly createdT
get(Mode mode)
Find the layer that supports the passed in mode.T
getByXmlId(String xmlId)
Find the layer based on non-indexed XML id rather than the managed internal id.protected IdGroupingToken
getIdToken()
Collect the token for id generation-
Methods inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
getManagedIdClass, recreateIds, reset, updateIdMapping
-
Methods inherited from class org.goplanit.utils.wrapper.LongMapWrapperImpl
containsKey, get, remove
-
Methods inherited from class org.goplanit.utils.wrapper.MapWrapperImpl
clear, contains, createEmptyInstance, findFirst, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, recreateIds, recreateIds, reset
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, contains, findFirst, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, size, toCollection, valuesAsNewSet
-
Methods inherited from interface org.goplanit.utils.network.layers.TransportLayers
getLayersOfType, isEachLayerEmpty, isNoLayers
-
-
-
-
Constructor Detail
-
TransportLayersImpl
public TransportLayersImpl(IdGroupingToken idToken)
Constructor- Parameters:
idToken
- to generated id's for infrastructure layers
-
TransportLayersImpl
public TransportLayersImpl(TransportLayersImpl<T> other)
Constructor- Parameters:
other
- to copy
-
-
Method Detail
-
getIdToken
protected IdGroupingToken getIdToken()
Collect the token for id generation- Returns:
- id token
-
get
public 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- Specified by:
get
in interfaceTransportLayers<T extends TransportLayer>
- Parameters:
mode
- to find the layer for- Returns:
- first matching layer
-
getByXmlId
public T getByXmlId(String xmlId)
Find the layer based on non-indexed XML id rather than the managed internal id.- Specified by:
getByXmlId
in interfaceTransportLayers<T extends TransportLayer>
- Parameters:
xmlId
- to find the layer for- Returns:
- first matching layer
-
clone
public abstract TransportLayersImpl<T> clone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created- Specified by:
clone
in interfaceManagedIdEntities<T extends TransportLayer>
- Specified by:
clone
in interfaceMapWrapper<Long,T extends TransportLayer>
- Specified by:
clone
in interfaceTransportLayers<T extends TransportLayer>
- Specified by:
clone
in classManagedIdEntitiesImpl<T extends TransportLayer>
- Returns:
- copy
-
-