Package org.goplanit.network.layers
Class MacroscopicNetworkLayersImpl
- 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>
-
- org.goplanit.network.layers.TopologicalLayersImpl<L>
-
- org.goplanit.network.layers.UntypedPhysicalNetworkLayersImpl<MacroscopicNetworkLayer>
-
- org.goplanit.network.layers.MacroscopicNetworkLayersImpl
-
- All Implemented Interfaces:
Iterable<MacroscopicNetworkLayer>,ManagedIdEntities<MacroscopicNetworkLayer>,MacroscopicNetworkLayers,NetworkLayers<MacroscopicNetworkLayer>,TopologicalLayers<MacroscopicNetworkLayer>,UntypedDirectedGraphLayers<MacroscopicNetworkLayer>,UntypedPhysicalNetworkLayers<MacroscopicNetworkLayer>,LongMapWrapper<MacroscopicNetworkLayer>,MapWrapper<Long,MacroscopicNetworkLayer>
public class MacroscopicNetworkLayersImpl extends UntypedPhysicalNetworkLayersImpl<MacroscopicNetworkLayer> implements MacroscopicNetworkLayers
Implementation of container and factory to manager layers. In this network type, all layers are of the Macroscopic physical network type- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected MacroscopicNetworkLayerFactoryfactoryfactory to use for creating layer instances-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description MacroscopicNetworkLayersImpl(MacroscopicNetworkLayersImpl other, boolean deepCopy, BiConsumer<MacroscopicNetworkLayer,MacroscopicNetworkLayer> mapper)Constructor, also creates new factory with this as its underlying containerMacroscopicNetworkLayersImpl(IdGroupingToken idToken)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacroscopicNetworkLayersImpldeepClone()Deep clone implementationMacroscopicNetworkLayersImpldeepCloneWithMapping(BiConsumer<MacroscopicNetworkLayer,MacroscopicNetworkLayer> mapper)Deep clone implementation where the mapping for its internal copies is captured by the provided mapperMacroscopicNetworkLayerFactorygetFactory()Factory to create instance of managed id entity (for this container class)MacroscopicNetworkLayersImplshallowClone()Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created-
Methods inherited from class org.goplanit.network.layers.TransportLayersImpl
get, getByXmlId, getIdToken
-
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, containsValue, createEmptyInstance, firstMatch, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, removeIf, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
clone, 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, 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
-
Methods inherited from interface org.goplanit.utils.network.layers.NetworkLayers
get, get, getByXmlId, getLayersOfType, getSupportedModes, isEachLayerEmpty
-
Methods inherited from interface org.goplanit.utils.network.layers.UntypedPhysicalNetworkLayers
getNumberOfLinks, getNumberOfLinkSegments, getNumberOfNodes
-
-
-
-
Field Detail
-
factory
protected final MacroscopicNetworkLayerFactory factory
factory to use for creating layer instances
-
-
Constructor Detail
-
MacroscopicNetworkLayersImpl
public MacroscopicNetworkLayersImpl(IdGroupingToken idToken)
Constructor- Parameters:
idToken- for id generation
-
MacroscopicNetworkLayersImpl
public MacroscopicNetworkLayersImpl(MacroscopicNetworkLayersImpl other, boolean deepCopy, BiConsumer<MacroscopicNetworkLayer,MacroscopicNetworkLayer> mapper)
Constructor, also creates new factory with this as its underlying container- Parameters:
other- to copydeepCopy- when true, create a deep copy, shallow copy otherwisemapper- apply to each mapping from original to copy
-
-
Method Detail
-
shallowClone
public MacroscopicNetworkLayersImpl shallowClone()
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:
shallowClonein interfaceMacroscopicNetworkLayers- Specified by:
shallowClonein interfaceManagedIdEntities<MacroscopicNetworkLayer>- Specified by:
shallowClonein interfaceMapWrapper<Long,MacroscopicNetworkLayer>- Specified by:
shallowClonein interfaceNetworkLayers<MacroscopicNetworkLayer>- Specified by:
shallowClonein interfaceTopologicalLayers<MacroscopicNetworkLayer>- Specified by:
shallowClonein interfaceUntypedDirectedGraphLayers<MacroscopicNetworkLayer>- Specified by:
shallowClonein interfaceUntypedPhysicalNetworkLayers<MacroscopicNetworkLayer>- Specified by:
shallowClonein classUntypedPhysicalNetworkLayersImpl<MacroscopicNetworkLayer>- Returns:
- copy
-
deepClone
public MacroscopicNetworkLayersImpl deepClone()
Deep clone implementation}- Specified by:
deepClonein interfaceMacroscopicNetworkLayers- Specified by:
deepClonein interfaceManagedIdEntities<MacroscopicNetworkLayer>- Specified by:
deepClonein interfaceNetworkLayers<MacroscopicNetworkLayer>- Specified by:
deepClonein interfaceTopologicalLayers<MacroscopicNetworkLayer>- Specified by:
deepClonein interfaceUntypedDirectedGraphLayers<MacroscopicNetworkLayer>- Specified by:
deepClonein interfaceUntypedPhysicalNetworkLayers<MacroscopicNetworkLayer>- Specified by:
deepClonein classUntypedPhysicalNetworkLayersImpl<MacroscopicNetworkLayer>- Returns:
- deep copy of entities
-
deepCloneWithMapping
public MacroscopicNetworkLayersImpl deepCloneWithMapping(BiConsumer<MacroscopicNetworkLayer,MacroscopicNetworkLayer> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMappingin interfaceManagedIdEntities<MacroscopicNetworkLayer>- Specified by:
deepCloneWithMappingin interfaceNetworkLayers<MacroscopicNetworkLayer>- Specified by:
deepCloneWithMappingin classTopologicalLayersImpl<MacroscopicNetworkLayer>- Parameters:
mapper- to apply to each mapping between original and copy- Returns:
- copy
-
getFactory
public MacroscopicNetworkLayerFactory getFactory()
Factory to create instance of managed id entity (for this container class)- Specified by:
getFactoryin interfaceMacroscopicNetworkLayers- Specified by:
getFactoryin interfaceManagedIdEntities<MacroscopicNetworkLayer>- Returns:
- entity factory
-
-