Class ACyclicSubGraphImpl
- java.lang.Object
-
- org.goplanit.graph.directed.acyclic.UntypedACyclicSubGraphImpl<DirectedVertex,EdgeSegment>
-
- org.goplanit.graph.directed.acyclic.ACyclicSubGraphImpl
-
- All Implemented Interfaces:
Comparable<IdAble>,Iterable<DirectedVertex>,ACyclicSubGraph,UntypedACyclicSubGraph<DirectedVertex,EdgeSegment>,DirectedSubGraph<DirectedVertex,EdgeSegment>,IdAble
public class ACyclicSubGraphImpl extends UntypedACyclicSubGraphImpl<DirectedVertex,EdgeSegment> implements ACyclicSubGraph
An acyclic sub graph contains a subset of the full graph without cycles. The active subset of the graph is tracked by explicitly registering edge segments. Edge segments are by definition directed. Whenever edge segments are added it is verified that no cycles are created. Also each edge segment that is added must connect to the existing subgraph's contents- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description ACyclicSubGraphImpl(ACyclicSubGraphImpl other, boolean deepCopy)Copy constructorACyclicSubGraphImpl(IdGroupingToken groupId, DirectedVertex rootVertex, boolean invertedDirection, int numberOfParentEdgeSegments)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ACyclicSubGraphImpldeepClone()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.ACyclicSubGraphImplshallowClone()Create a shallow copy of this entity-
Methods inherited from class org.goplanit.graph.directed.acyclic.UntypedACyclicSubGraphImpl
addEdgeSegment, addRootVertex, containsEdgeSegment, getId, getNumberOfVertices, getRootVertices, getVertexData, isDirectionInverted, iterator, postVisit, preVisit, removeEdgeSegment, topologicalSort
-
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.directed.DirectedSubGraph
addEdgeSegment, containsEdgeSegment, getNumberOfEdgeSegments, getNumberOfVertices, isEmpty, removeEdgeSegment
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.graph.directed.acyclic.UntypedACyclicSubGraph
addRootVertex, getRootVertices, getTopologicalIterator, getTopologicalIterator, isDirectionInverted, topologicalSort
-
-
-
-
Constructor Detail
-
ACyclicSubGraphImpl
public ACyclicSubGraphImpl(IdGroupingToken groupId, DirectedVertex rootVertex, boolean invertedDirection, int numberOfParentEdgeSegments)
Constructor- Parameters:
groupId- generate id based on the group it resides inrootVertex- of the daginvertedDirection- when true dag ends at root and all other vertices precede it, when false the root is the starting point and all other vertices succeed itnumberOfParentEdgeSegments- number of directed edge segments of the parent this subgraph is a subset from
-
ACyclicSubGraphImpl
public ACyclicSubGraphImpl(ACyclicSubGraphImpl other, boolean deepCopy)
Copy constructor- Parameters:
other- to copydeepCopy- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
shallowClone
public ACyclicSubGraphImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceACyclicSubGraph- Specified by:
shallowClonein interfaceDirectedSubGraph<DirectedVertex,EdgeSegment>- Specified by:
shallowClonein interfaceIdAble- Specified by:
shallowClonein interfaceUntypedACyclicSubGraph<DirectedVertex,EdgeSegment>- Overrides:
shallowClonein classUntypedACyclicSubGraphImpl<DirectedVertex,EdgeSegment>- Returns:
- shallow copy of entity
-
deepClone
public ACyclicSubGraphImpl 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:
deepClonein interfaceACyclicSubGraph- Specified by:
deepClonein interfaceDirectedSubGraph<DirectedVertex,EdgeSegment>- Specified by:
deepClonein interfaceIdAble- Specified by:
deepClonein interfaceUntypedACyclicSubGraph<DirectedVertex,EdgeSegment>- Overrides:
deepClonein classUntypedACyclicSubGraphImpl<DirectedVertex,EdgeSegment>- Returns:
- deep copy of entity
-
-