Package org.goplanit.graph.directed
Class DirectedVerticesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.graph.GraphEntitiesImpl<DirectedVertex>
-
- org.goplanit.graph.directed.DirectedVerticesImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<DirectedVertex>
,DirectedVertices
,GraphEntities<DirectedVertex>
,LongMapWrapper<DirectedVertex>
,MapWrapper<Long,DirectedVertex>
public class DirectedVerticesImpl extends GraphEntitiesImpl<DirectedVertex> implements DirectedVertices
DirectedVertices implementation container and factory access- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description DirectedVerticesImpl(DirectedVerticesImpl other, boolean deepCopy, BiConsumer<DirectedVertex,DirectedVertex> biConsumer)
Copy constructor, also creates a new factory with reference to this containerDirectedVerticesImpl(IdGroupingToken groupId)
ConstructorDirectedVerticesImpl(IdGroupingToken groupId, DirectedVertexFactory directedVertexFactory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectedVerticesImpl
deepClone()
Deep clone implementationDirectedVerticesImpl
deepCloneWithMapping(BiConsumer<DirectedVertex,DirectedVertex> mapper)
Deep clone implementation with mapping retained between original and copies createdDirectedVertexFactory
getFactory()
Collect the vertex factory to use for creating instancesDirectedVerticesImpl
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
-
DirectedVerticesImpl
public DirectedVerticesImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
DirectedVerticesImpl
public DirectedVerticesImpl(IdGroupingToken groupId, DirectedVertexFactory directedVertexFactory)
Constructor- Parameters:
groupId
- to usedirectedVertexFactory
- to use
-
DirectedVerticesImpl
public DirectedVerticesImpl(DirectedVerticesImpl other, boolean deepCopy, BiConsumer<DirectedVertex,DirectedVertex> biConsumer)
Copy constructor, also creates a new factory with reference to this container- Parameters:
other
- 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 DirectedVertexFactory getFactory()
Collect the vertex factory to use for creating instances- Specified by:
getFactory
in interfaceDirectedVertices
- Specified by:
getFactory
in interfaceGraphEntities<DirectedVertex>
- Returns:
- vertexFactory to create edges for this container
-
shallowClone
public DirectedVerticesImpl 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 interfaceDirectedVertices
- Specified by:
shallowClone
in interfaceGraphEntities<DirectedVertex>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,DirectedVertex>
- Specified by:
shallowClone
in classGraphEntitiesImpl<DirectedVertex>
- Returns:
- copy
-
deepClone
public DirectedVerticesImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceDirectedVertices
- Specified by:
deepClone
in interfaceGraphEntities<DirectedVertex>
- Specified by:
deepClone
in classGraphEntitiesImpl<DirectedVertex>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public DirectedVerticesImpl deepCloneWithMapping(BiConsumer<DirectedVertex,DirectedVertex> mapper)
Deep clone implementation with mapping retained between original and copies created- Specified by:
deepCloneWithMapping
in interfaceGraphEntities<DirectedVertex>
- Specified by:
deepCloneWithMapping
in classGraphEntitiesImpl<DirectedVertex>
- 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
-
-