Package org.goplanit.path
Class ManagedDirectedPathsImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<ManagedDirectedPath>
-
- org.goplanit.path.ManagedDirectedPathsImpl
-
- All Implemented Interfaces:
Iterable<ManagedDirectedPath>
,ManagedIdEntities<ManagedDirectedPath>
,ManagedDirectedPaths
,LongMapWrapper<ManagedDirectedPath>
,MapWrapper<Long,ManagedDirectedPath>
public class ManagedDirectedPathsImpl extends ManagedIdEntitiesImpl<ManagedDirectedPath> implements ManagedDirectedPaths
Implementation of (managed) DirectedPaths interface- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description ManagedDirectedPathsImpl(ManagedDirectedPathsImpl directedPathsImpl, boolean deepCopy, BiConsumer<ManagedDirectedPath,ManagedDirectedPath> mapper)
Copy constructor, also creates new factory with this as its underlying containerManagedDirectedPathsImpl(IdGroupingToken groupId)
ConstructorManagedDirectedPathsImpl(IdGroupingToken groupId, ContainerisedDirectedPathFactoryImpl directedPathFactory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManagedDirectedPathsImpl
deepClone()
Deep clone implementationManagedDirectedPathsImpl
deepCloneWithMapping(BiConsumer<ManagedDirectedPath,ManagedDirectedPath> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperContainerisedDirectedPathFactoryImpl
getFactory()
Factory to create paths on this containerManagedDirectedPathsImpl
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.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
-
-
-
-
Constructor Detail
-
ManagedDirectedPathsImpl
public ManagedDirectedPathsImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
ManagedDirectedPathsImpl
public ManagedDirectedPathsImpl(IdGroupingToken groupId, ContainerisedDirectedPathFactoryImpl directedPathFactory)
Constructor- Parameters:
groupId
- to use for creating ids for instancesdirectedPathFactory
- the factory to use
-
ManagedDirectedPathsImpl
public ManagedDirectedPathsImpl(ManagedDirectedPathsImpl directedPathsImpl, boolean deepCopy, BiConsumer<ManagedDirectedPath,ManagedDirectedPath> mapper)
Copy constructor, also creates new factory with this as its underlying container- Parameters:
directedPathsImpl
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwisemapper
- to use for tracking mapping between original and copied entities (may be null)
-
-
Method Detail
-
getFactory
public ContainerisedDirectedPathFactoryImpl getFactory()
Factory to create paths on this container- Specified by:
getFactory
in interfaceManagedDirectedPaths
- Specified by:
getFactory
in interfaceManagedIdEntities<ManagedDirectedPath>
- Returns:
- entity factory
-
shallowClone
public ManagedDirectedPathsImpl 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 interfaceManagedDirectedPaths
- Specified by:
shallowClone
in interfaceManagedIdEntities<ManagedDirectedPath>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,ManagedDirectedPath>
- Specified by:
shallowClone
in classManagedIdEntitiesImpl<ManagedDirectedPath>
- Returns:
- copy
-
deepClone
public ManagedDirectedPathsImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceManagedDirectedPaths
- Specified by:
deepClone
in interfaceManagedIdEntities<ManagedDirectedPath>
- Specified by:
deepClone
in classManagedIdEntitiesImpl<ManagedDirectedPath>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public ManagedDirectedPathsImpl deepCloneWithMapping(BiConsumer<ManagedDirectedPath,ManagedDirectedPath> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<ManagedDirectedPath>
- Specified by:
deepCloneWithMapping
in classManagedIdEntitiesImpl<ManagedDirectedPath>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
-