Package org.goplanit.graph.directed
Class DirectedEdgesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.graph.GraphEntitiesImpl<DirectedEdge>
-
- org.goplanit.graph.directed.DirectedEdgesImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<DirectedEdge>
,DirectedEdges
,GraphEntities<DirectedEdge>
,LongMapWrapper<DirectedEdge>
,MapWrapper<Long,DirectedEdge>
public class DirectedEdgesImpl extends GraphEntitiesImpl<DirectedEdge> implements DirectedEdges
Implementation of DirectedEdges interface- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description DirectedEdgesImpl(DirectedEdgesImpl directedEdgesImpl, boolean deepCopy, BiConsumer<DirectedEdge,DirectedEdge> biConsumer)
Copy constructor, also creates a new factory with reference to this containerDirectedEdgesImpl(IdGroupingToken groupId)
ConstructorDirectedEdgesImpl(IdGroupingToken groupId, DirectedEdgeFactory directedEdgeFactory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectedEdgesImpl
deepClone()
Deep clone implementationDirectedEdgesImpl
deepCloneWithMapping(BiConsumer<DirectedEdge,DirectedEdge> mapper)
Deep clone implementation with mapping retained between original and copies createdDirectedEdgeFactory
getFactory()
Collect the directed edge factory to use for creating instancesDirectedEdgesImpl
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.GraphEntitiesImpl
getByXmlId
-
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
containsKey, get, remove
-
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
-
DirectedEdgesImpl
public DirectedEdgesImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
DirectedEdgesImpl
public DirectedEdgesImpl(IdGroupingToken groupId, DirectedEdgeFactory directedEdgeFactory)
Constructor- Parameters:
groupId
- to use for creating ids for instancesdirectedEdgeFactory
- the factory to use
-
DirectedEdgesImpl
public DirectedEdgesImpl(DirectedEdgesImpl directedEdgesImpl, boolean deepCopy, BiConsumer<DirectedEdge,DirectedEdge> biConsumer)
Copy constructor, also creates a new factory with reference to this container- Parameters:
directedEdgesImpl
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwisebiConsumer
- when deepCopy applied to each original and copy, may be null
-
-
Method Detail
-
getFactory
public DirectedEdgeFactory getFactory()
Collect the directed edge factory to use for creating instances- Specified by:
getFactory
in interfaceDirectedEdges
- Specified by:
getFactory
in interfaceGraphEntities<DirectedEdge>
- Returns:
- directedEdgeFactory to create edges for this container
-
shallowClone
public DirectedEdgesImpl 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 interfaceDirectedEdges
- Specified by:
shallowClone
in interfaceGraphEntities<DirectedEdge>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,DirectedEdge>
- Specified by:
shallowClone
in classGraphEntitiesImpl<DirectedEdge>
- Returns:
- copy
-
deepClone
public DirectedEdgesImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceDirectedEdges
- Specified by:
deepClone
in interfaceGraphEntities<DirectedEdge>
- Specified by:
deepClone
in classGraphEntitiesImpl<DirectedEdge>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public DirectedEdgesImpl deepCloneWithMapping(BiConsumer<DirectedEdge,DirectedEdge> mapper)
Deep clone implementation with mapping retained between original and copies created- Specified by:
deepCloneWithMapping
in interfaceGraphEntities<DirectedEdge>
- Specified by:
deepCloneWithMapping
in classGraphEntitiesImpl<DirectedEdge>
- Parameters:
mapper
- that is applied to each deep copy entity mapping pair of origin and copy- Returns:
- pair with deep copy of entities and mapping from original entities to deep copies of these entities
-
-