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 protectedEdgesImpl(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 EdgesImpldeepClone()Deep clone implementationEdgesImpldeepCloneWithMapping(BiConsumer<Edge,Edge> mapper)Deep clone implementation with mapping retained between original and copies createdEdgeFactorygetFactory()Collect the edge factory to use for creating instancesEdgesImplshallowClone()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:
getFactoryin interfaceEdges- Specified by:
getFactoryin 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:
shallowClonein interfaceEdges- Specified by:
shallowClonein interfaceGraphEntities<Edge>- Specified by:
shallowClonein interfaceMapWrapper<Long,Edge>- Specified by:
shallowClonein classGraphEntitiesImpl<Edge>- Returns:
- copy
-
deepClone
public EdgesImpl deepClone()
Deep clone implementation- Specified by:
deepClonein interfaceEdges- Specified by:
deepClonein interfaceGraphEntities<Edge>- Specified by:
deepClonein 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:
deepCloneWithMappingin interfaceEdges- Specified by:
deepCloneWithMappingin interfaceGraphEntities<Edge>- Specified by:
deepCloneWithMappingin 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
-
-