Package org.goplanit.graph
Class EdgesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.graph.GraphEntitiesImpl<Edge>
-
- org.goplanit.graph.EdgesImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<Edge>
,Edges
,GraphEntities<Edge>
,LongMapWrapper<Edge>
,MapWrapper<Long,Edge>
public class EdgesImpl extends GraphEntitiesImpl<Edge> implements Edges
Implementation of Edges interface- Author:
- markr
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EdgesImpl(EdgesImpl edgesImpl, boolean deepCopy, BiConsumer<Edge,Edge> biConsumer)
Copy constructor, also creates a new factory with reference to this containerEdgesImpl(EdgeFactory edgeFactory)
ConstructorEdgesImpl(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EdgesImpl
deepClone()
Deep clone implementationEdgesImpl
deepCloneWithMapping(BiConsumer<Edge,Edge> mapper)
Deep clone implementation with mapping retained between original and copies createdEdgeFactory
getFactory()
Collect the edge factory to use for creating instancesEdgesImpl
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
-
EdgesImpl
protected EdgesImpl(EdgesImpl edgesImpl, boolean deepCopy, BiConsumer<Edge,Edge> biConsumer)
Copy constructor, also creates a new factory with reference to this container- Parameters:
edgesImpl
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwisebiConsumer
- when deepCopy applied to each original and copy, may be null
-
EdgesImpl
public EdgesImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
EdgesImpl
public EdgesImpl(EdgeFactory edgeFactory)
Constructor- Parameters:
edgeFactory
- to use
-
-
Method Detail
-
getFactory
public EdgeFactory getFactory()
Collect the edge factory to use for creating instances- Specified by:
getFactory
in interfaceEdges
- Specified by:
getFactory
in interfaceGraphEntities<Edge>
- Returns:
- edgeFactory to create edges for this container
-
shallowClone
public EdgesImpl 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 interfaceEdges
- Specified by:
shallowClone
in interfaceGraphEntities<Edge>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,Edge>
- Specified by:
shallowClone
in classGraphEntitiesImpl<Edge>
- Returns:
- copy
-
deepClone
public EdgesImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceEdges
- Specified by:
deepClone
in interfaceGraphEntities<Edge>
- Specified by:
deepClone
in classGraphEntitiesImpl<Edge>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public EdgesImpl deepCloneWithMapping(BiConsumer<Edge,Edge> mapper)
Deep clone implementation with mapping retained between original and copies created- Specified by:
deepCloneWithMapping
in interfaceEdges
- Specified by:
deepCloneWithMapping
in interfaceGraphEntities<Edge>
- Specified by:
deepCloneWithMapping
in classGraphEntitiesImpl<Edge>
- 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
-
-