Package org.goplanit.graph.directed
Class UntypedDirectedGraphImpl<V extends DirectedVertex,E extends DirectedEdge,ES extends EdgeSegment>
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.graph.UntypedGraphImpl<V,E>
-
- org.goplanit.graph.directed.UntypedDirectedGraphImpl<V,E,ES>
-
- All Implemented Interfaces:
Comparable<IdAble>
,UntypedDirectedGraph<V,E,ES>
,UntypedGraph<V,E>
,IdAble
,ManagedId
- Direct Known Subclasses:
ConjugateDirectedGraphImpl
,DirectedGraphImpl
public class UntypedDirectedGraphImpl<V extends DirectedVertex,E extends DirectedEdge,ES extends EdgeSegment> extends UntypedGraphImpl<V,E> implements UntypedDirectedGraph<V,E,ES>
A directed graph implementation consisting of directed vertices and directed edges- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected GraphEntities<ES>
edgeSegments
class instance containing all edge segments-
Fields inherited from class org.goplanit.graph.UntypedGraphImpl
edges, vertices
-
Fields inherited from interface org.goplanit.utils.graph.UntypedGraph
GRAPH_ID_CLASS
-
-
Constructor Summary
Constructors Constructor Description UntypedDirectedGraphImpl(UntypedDirectedGraphImpl<V,E,ES> directedGraphImpl, boolean deepCopy)
Copy constructorUntypedDirectedGraphImpl(UntypedDirectedGraphImpl<V,E,ES> directedGraphImpl, boolean deepCopy, GraphEntityDeepCopyMapper<V> vertexMapper, GraphEntityDeepCopyMapper<E> edgeMapper, GraphEntityDeepCopyMapper<ES> edgeSegmentMapper)
Copy constructorUntypedDirectedGraphImpl(IdGroupingToken groupToken, GraphEntities<V> vertices, GraphEntities<E> edges, GraphEntities<ES> edgeSegments)
DirectedGraph Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UntypedDirectedGraphImpl<V,E,ES>
deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call.GraphEntities<ES>
getEdgeSegments()
Collect edges segments of graphUntypedDirectedGraphImpl<V,E,ES>
shallowClone()
Create a shallow copy of this entityUntypedDirectedGraphImpl<V,E,ES>
smartDeepClone(GraphEntityDeepCopyMapper<V> vertexMapper, GraphEntityDeepCopyMapper<E> edgeMapper, GraphEntityDeepCopyMapper<ES> edgeSegmentMapper)
A smart deep clone updates known interdependencies between vertices, edges, and edge segments utilising the graph entity deep copy mappers-
Methods inherited from class org.goplanit.graph.UntypedGraphImpl
generatedGraphId, getEdges, getGraphIdGroupingToken, getIdClass, getVertices, recreateManagedIds, smartDeepClone
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
getIdClass, recreateManagedIds, resetChildManagedIdEntities
-
Methods inherited from interface org.goplanit.utils.graph.UntypedDirectedGraph
isEmpty, validate
-
Methods inherited from interface org.goplanit.utils.graph.UntypedGraph
getEdges, getVertices, transformGeometries
-
-
-
-
Field Detail
-
edgeSegments
protected final GraphEntities<ES extends EdgeSegment> edgeSegments
class instance containing all edge segments
-
-
Constructor Detail
-
UntypedDirectedGraphImpl
public UntypedDirectedGraphImpl(IdGroupingToken groupToken, GraphEntities<V> vertices, GraphEntities<E> edges, GraphEntities<ES> edgeSegments)
DirectedGraph Constructor- Parameters:
groupToken
- contiguous id generation within this group for instances of this classvertices
- to useedges
- to useedgeSegments
- to use
-
UntypedDirectedGraphImpl
public UntypedDirectedGraphImpl(UntypedDirectedGraphImpl<V,E,ES> directedGraphImpl, boolean deepCopy)
Copy constructor- Parameters:
directedGraphImpl
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
UntypedDirectedGraphImpl
public UntypedDirectedGraphImpl(UntypedDirectedGraphImpl<V,E,ES> directedGraphImpl, boolean deepCopy, GraphEntityDeepCopyMapper<V> vertexMapper, GraphEntityDeepCopyMapper<E> edgeMapper, GraphEntityDeepCopyMapper<ES> edgeSegmentMapper)
Copy constructor- Parameters:
directedGraphImpl
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwisevertexMapper
- tracking how orignal vertices are mapped to new vertices in case of deep copyedgeMapper
- tracking how orignal edges are mapped to new edges in case of deep copyedgeSegmentMapper
- tracking how orignal edge segments are mapped to new edge segments in case of deep copy
-
-
Method Detail
-
getEdgeSegments
public GraphEntities<ES> getEdgeSegments()
Collect edges segments of graph- Specified by:
getEdgeSegments
in interfaceUntypedDirectedGraph<V extends DirectedVertex,E extends DirectedEdge,ES extends EdgeSegment>
- Returns:
- edges segments
-
shallowClone
public UntypedDirectedGraphImpl<V,E,ES> shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in interfaceUntypedDirectedGraph<V extends DirectedVertex,E extends DirectedEdge,ES extends EdgeSegment>
- Specified by:
shallowClone
in interfaceUntypedGraph<V extends DirectedVertex,E extends DirectedEdge>
- Overrides:
shallowClone
in classUntypedGraphImpl<V extends DirectedVertex,E extends DirectedEdge>
- Returns:
- shallow copy of entity
-
deepClone
public UntypedDirectedGraphImpl<V,E,ES> deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in interfaceUntypedDirectedGraph<V extends DirectedVertex,E extends DirectedEdge,ES extends EdgeSegment>
- Specified by:
deepClone
in interfaceUntypedGraph<V extends DirectedVertex,E extends DirectedEdge>
- Overrides:
deepClone
in classUntypedGraphImpl<V extends DirectedVertex,E extends DirectedEdge>
- Returns:
- deep copy of entity
-
smartDeepClone
public UntypedDirectedGraphImpl<V,E,ES> smartDeepClone(GraphEntityDeepCopyMapper<V> vertexMapper, GraphEntityDeepCopyMapper<E> edgeMapper, GraphEntityDeepCopyMapper<ES> edgeSegmentMapper)
A smart deep clone updates known interdependencies between vertices, edges, and edge segments utilising the graph entity deep copy mappers- Parameters:
vertexMapper
- tracking original to copy mappingsedgeMapper
- tracking original to copy mappingsedgeSegmentMapper
- tracking original to copy mappings- Returns:
- created copy
-
-