Package org.goplanit.graph
Class VerticesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.graph.GraphEntitiesImpl<Vertex>
-
- org.goplanit.graph.VerticesImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<Vertex>
,GraphEntities<Vertex>
,Vertices
,LongMapWrapper<Vertex>
,MapWrapper<Long,Vertex>
public class VerticesImpl extends GraphEntitiesImpl<Vertex> implements Vertices
Vertices implementation container and factory access- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description VerticesImpl(VerticesImpl verticesImpl, boolean deepCopy, BiConsumer<Vertex,Vertex> biConsumer)
Copy constructor, also creates a new factory with reference to this containerVerticesImpl(IdGroupingToken groupId)
ConstructorVerticesImpl(IdGroupingToken groupId, VertexFactory vertexFactory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VerticesImpl
deepClone()
Deep clone implementationVerticesImpl
deepCloneWithMapping(BiConsumer<Vertex,Vertex> mapper)
Deep clone implementation with mapping retained between original and copies createdVertexFactory
getFactory()
Collect the vertex factory to use for creating instancesVerticesImpl
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
-
VerticesImpl
public VerticesImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
VerticesImpl
public VerticesImpl(IdGroupingToken groupId, VertexFactory vertexFactory)
Constructor- Parameters:
groupId
- to usevertexFactory
- to use
-
VerticesImpl
public VerticesImpl(VerticesImpl verticesImpl, boolean deepCopy, BiConsumer<Vertex,Vertex> biConsumer)
Copy constructor, also creates a new factory with reference to this container- Parameters:
verticesImpl
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwisebiConsumer
- apply to each copy
-
-
Method Detail
-
getFactory
public VertexFactory getFactory()
Collect the vertex factory to use for creating instances- Specified by:
getFactory
in interfaceGraphEntities<Vertex>
- Specified by:
getFactory
in interfaceVertices
- Returns:
- vertexFactory to create edges for this container
-
shallowClone
public VerticesImpl 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<Vertex>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,Vertex>
- Specified by:
shallowClone
in interfaceVertices
- Specified by:
shallowClone
in classGraphEntitiesImpl<Vertex>
- Returns:
- copy
-
deepClone
public VerticesImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceGraphEntities<Vertex>
- Specified by:
deepClone
in interfaceVertices
- Specified by:
deepClone
in classGraphEntitiesImpl<Vertex>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public VerticesImpl deepCloneWithMapping(BiConsumer<Vertex,Vertex> mapper)
Description copied from class:GraphEntitiesImpl
Deep clone implementation with mapping retained between original and copies created- Specified by:
deepCloneWithMapping
in interfaceGraphEntities<Vertex>
- Specified by:
deepCloneWithMapping
in interfaceVertices
- Specified by:
deepCloneWithMapping
in classGraphEntitiesImpl<Vertex>
- 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
-
-