Class MacroscopicLinkSegmentsImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<E>
-
- org.goplanit.utils.graph.ManagedGraphEntitiesImpl<MacroscopicLinkSegment>
-
- org.goplanit.network.layer.macroscopic.MacroscopicLinkSegmentsImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<MacroscopicLinkSegment>
,GraphEntities<MacroscopicLinkSegment>
,ManagedGraphEntities<MacroscopicLinkSegment>
,ManagedIdEntities<MacroscopicLinkSegment>
,MacroscopicLinkSegments
,LongMapWrapper<MacroscopicLinkSegment>
,MapWrapper<Long,MacroscopicLinkSegment>
public class MacroscopicLinkSegmentsImpl extends ManagedGraphEntitiesImpl<MacroscopicLinkSegment> implements MacroscopicLinkSegments
Link segments container implementation- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description MacroscopicLinkSegmentsImpl(MacroscopicLinkSegmentsImpl other, boolean deepCopy, BiConsumer<MacroscopicLinkSegment,MacroscopicLinkSegment> mapper)
Copy constructor, also creates new factory with this as its underlying containerMacroscopicLinkSegmentsImpl(IdGroupingToken groupId)
ConstructorMacroscopicLinkSegmentsImpl(IdGroupingToken groupId, MacroscopicLinkSegmentFactory linkSegmentFactory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacroscopicLinkSegmentsImpl
deepClone()
Deep clone implementationMacroscopicLinkSegmentsImpl
deepCloneWithMapping(BiConsumer<MacroscopicLinkSegment,MacroscopicLinkSegment> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperMacroscopicLinkSegmentFactory
getFactory()
Factory to create instance of graph entity (for this container class)MacroscopicLinkSegmentsImpl
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-
Methods inherited from class org.goplanit.utils.graph.ManagedGraphEntitiesImpl
getByXmlId
-
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 org.goplanit.utils.graph.GraphEntities
forEachMatchingIdIn, getByExternalId, getByXmlId
-
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.network.layer.macroscopic.MacroscopicLinkSegments
getFreeFlowTravelTimeHourPerLinkSegment
-
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
-
-
-
-
Constructor Detail
-
MacroscopicLinkSegmentsImpl
public MacroscopicLinkSegmentsImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
MacroscopicLinkSegmentsImpl
public MacroscopicLinkSegmentsImpl(IdGroupingToken groupId, MacroscopicLinkSegmentFactory linkSegmentFactory)
Constructor- Parameters:
groupId
- to use for creating ids for instanceslinkSegmentFactory
- the factory to use
-
MacroscopicLinkSegmentsImpl
public MacroscopicLinkSegmentsImpl(MacroscopicLinkSegmentsImpl other, boolean deepCopy, BiConsumer<MacroscopicLinkSegment,MacroscopicLinkSegment> mapper)
Copy constructor, also creates new factory with this as its underlying container- Parameters:
other
- to copydeepCopy
- when true, create a deep cpy, shallow copy otherwisemapper
- to apply in case of deep copy to each original to copy combination (when provided, may be null)
-
-
Method Detail
-
getFactory
public MacroscopicLinkSegmentFactory getFactory()
Factory to create instance of graph entity (for this container class)- Specified by:
getFactory
in interfaceGraphEntities<MacroscopicLinkSegment>
- Specified by:
getFactory
in interfaceMacroscopicLinkSegments
- Specified by:
getFactory
in interfaceManagedIdEntities<MacroscopicLinkSegment>
- Returns:
- entity factory
-
shallowClone
public MacroscopicLinkSegmentsImpl 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:
shallowClone
in interfaceGraphEntities<MacroscopicLinkSegment>
- Specified by:
shallowClone
in interfaceMacroscopicLinkSegments
- Specified by:
shallowClone
in interfaceManagedGraphEntities<MacroscopicLinkSegment>
- Specified by:
shallowClone
in interfaceManagedIdEntities<MacroscopicLinkSegment>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,MacroscopicLinkSegment>
- Specified by:
shallowClone
in classManagedGraphEntitiesImpl<MacroscopicLinkSegment>
- Returns:
- copy
-
deepClone
public MacroscopicLinkSegmentsImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceGraphEntities<MacroscopicLinkSegment>
- Specified by:
deepClone
in interfaceMacroscopicLinkSegments
- Specified by:
deepClone
in interfaceManagedGraphEntities<MacroscopicLinkSegment>
- Specified by:
deepClone
in interfaceManagedIdEntities<MacroscopicLinkSegment>
- Specified by:
deepClone
in classManagedGraphEntitiesImpl<MacroscopicLinkSegment>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public MacroscopicLinkSegmentsImpl deepCloneWithMapping(BiConsumer<MacroscopicLinkSegment,MacroscopicLinkSegment> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceGraphEntities<MacroscopicLinkSegment>
- Specified by:
deepCloneWithMapping
in interfaceMacroscopicLinkSegments
- Specified by:
deepCloneWithMapping
in interfaceManagedGraphEntities<MacroscopicLinkSegment>
- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<MacroscopicLinkSegment>
- Specified by:
deepCloneWithMapping
in classManagedGraphEntitiesImpl<MacroscopicLinkSegment>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
-