public abstract class BaseDataflowTaskGraph<TV,TE> extends java.lang.Object implements ITaskGraph<TV,TE>
| Constructor and Description |
|---|
BaseDataflowTaskGraph() |
BaseDataflowTaskGraph(java.util.Comparator<TV> comparator,
java.util.Comparator<TE> eComparator) |
| Modifier and Type | Method and Description |
|---|---|
TE |
addTaskEdge(TV sourceTaskVertex,
TV targetTaskVertex)
If the task edge is not null and the task edge is not available in the task edge set,
it will add the task edge to the edge set.
|
boolean |
addTaskEdge(TV taskVertex1,
TV taskVertex2,
TE taskEdge)
This method first check whether the task edge is null or not, then it will validate both the
source and target vertex and create the directed dataflow edge between those task vertices.
|
boolean |
addTaskVertex(TV taskVertex)
If the task vertex is not null and the task vertex is not available in the task vertex set,
it will add the task vertex to the vertices set.
|
abstract void |
build()
Build the internal structures of the graph, so that it can be searched
|
java.util.Set<TV> |
childrenOfTask(TV t)
This method is helpful to find out the children of the task vertex (t).
|
TV |
connectedChildTask(TV task,
TE edge)
This method is used to calculate the connected child tasks between the task vertex(t) and the
task edge (TE)
|
TV |
connectedParentTask(TV task,
TE edge)
This method returns the connected parent tasks between the task vertex(t) and the task edge(TE)
|
boolean |
containsTaskEdge(TE taskEdge)
This method is used to identify the duplicate task edge for the same two tasks in the graph.
|
boolean |
containsTaskEdge(TV sourceTaskVertex,
TV targetTaskVertex)
This method is to validate that whether the source and target task vertex has task edge.
|
boolean |
containsTaskEdge(TV sourceTaskVertex,
TV targetTaskVertex,
TE taskEdge) |
boolean |
containsTaskVertex(TV taskVertex)
This method is to validate whether the task graph vertices has the task vertex(TV)
|
java.util.Set<TE> |
getAllTaskEdges(TV sourceTaskVertex,
TV targetTaskVertex)
This method returns the directed dataflow edges between the source and target task vertex
|
DirectedEdge<TV,TE> |
getDataflowTaskEdge(TE taskEdge) |
java.util.Set<DirectedEdge<TV,TE>> |
getDirectedEdgesSet() |
java.util.Set<TV> |
getTaskVertexSet()
This method returns the set of task vertices in the task graph.
|
boolean |
hasCycle()
This method gets the complete task vertex of the task graph and call
the detect cycle method to identify if there is a cycle in the task graph.
|
java.util.Set<TE> |
incomingTaskEdgesOf(TV taskVertex)
This method returns the incoming task edges of the task vertex.
|
int |
inDegreeOfTask(TV taskVertex)
This method returns the in-degree of the task vertex (TV).
|
int |
outDegreeOfTask(TV taskVertex)
This method returns the out degree of the task vertex (TV) if there is any edge from the
source task vertex to the task vertex.
|
java.util.Set<TE> |
outgoingTaskEdgesOf(TV taskVertex)
This method calculates the out going task edges of the task vertex (TV).
|
java.util.Set<TV> |
parentsOfTask(TV t)
This method is helpful to find out the parents of the task vertex (t).
|
boolean |
removeAllTaskEdges(java.util.Collection<? extends TE> taskEdges)
This method remove all the task edges in the collection object.
|
java.util.Set<TE> |
removeAllTaskEdges(TV sourceTaskVertex,
TV targetTaskVertex)
This method is responsible for removing all the task edges between the source and target
task vertex.
|
boolean |
removeAllTaskVertices(java.util.Collection<? extends TV> taskVertices)
This method remove all the task vertices in the collection object.
|
boolean |
removeTaskEdge(TE taskEdge)
This method removes the task edge (TE) from the task graph.
|
TE |
removeTaskEdge(TV sourceVertex,
TV targetVertex)
This method removes the task edge between the source task vertex and the target task vertex.
|
boolean |
removeTaskVertex(TV taskVertex)
This method removes the task vertex (TV) from the task graph.
|
java.util.Set<TE> |
taskEdgeSet()
This method returns the set of task edges in the task graph.
|
java.util.Set<TE> |
taskEdgesOf(TV taskVertex)
This method returns the task edge set of the task vertex (TV).
|
boolean |
validate()
This method validates the task graph to finds that if there is a self-loop in the task
vertex set (task graph)
|
protected void |
validateTaskVertex(TV taskVertex)
This method validates that whether the task graph contains the task vertex (TV).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGraphNamepublic boolean addTaskVertex(TV taskVertex)
addTaskVertex in interface ITaskGraph<TV,TE>public TE addTaskEdge(TV sourceTaskVertex, TV targetTaskVertex)
addTaskEdge in interface ITaskGraph<TV,TE>public boolean addTaskEdge(TV taskVertex1, TV taskVertex2, TE taskEdge)
addTaskEdge in interface ITaskGraph<TV,TE>public java.util.Set<TE> getAllTaskEdges(TV sourceTaskVertex, TV targetTaskVertex)
getAllTaskEdges in interface ITaskGraph<TV,TE>public boolean containsTaskEdge(TE taskEdge)
containsTaskEdge in interface ITaskGraph<TV,TE>public boolean containsTaskVertex(TV taskVertex)
containsTaskVertex in interface ITaskGraph<TV,TE>public java.util.Set<TE> incomingTaskEdgesOf(TV taskVertex)
incomingTaskEdgesOf in interface ITaskGraph<TV,TE>public int outDegreeOfTask(TV taskVertex)
outDegreeOfTask in interface ITaskGraph<TV,TE>public TE removeTaskEdge(TV sourceVertex, TV targetVertex)
removeTaskEdge in interface ITaskGraph<TV,TE>public boolean removeTaskEdge(TE taskEdge)
removeTaskEdge in interface ITaskGraph<TV,TE>public boolean removeTaskVertex(TV taskVertex)
removeTaskVertex in interface ITaskGraph<TV,TE>public java.util.Set<TV> getTaskVertexSet()
getTaskVertexSet in interface ITaskGraph<TV,TE>public java.util.Set<DirectedEdge<TV,TE>> getDirectedEdgesSet()
public java.util.Set<TE> taskEdgeSet()
taskEdgeSet in interface ITaskGraph<TV,TE>public TV connectedChildTask(TV task, TE edge)
public TV connectedParentTask(TV task, TE edge)
public java.util.Set<TE> taskEdgesOf(TV taskVertex)
taskEdgesOf in interface ITaskGraph<TV,TE>public java.util.Set<TE> outgoingTaskEdgesOf(TV taskVertex)
outgoingTaskEdgesOf in interface ITaskGraph<TV,TE>public java.util.Set<TV> childrenOfTask(TV t)
public java.util.Set<TV> parentsOfTask(TV t)
public int inDegreeOfTask(TV taskVertex)
inDegreeOfTask in interface ITaskGraph<TV,TE>public boolean containsTaskEdge(TV sourceTaskVertex, TV targetTaskVertex)
containsTaskEdge in interface ITaskGraph<TV,TE>public boolean containsTaskEdge(TV sourceTaskVertex, TV targetTaskVertex, TE taskEdge)
public boolean removeAllTaskEdges(java.util.Collection<? extends TE> taskEdges)
removeAllTaskEdges in interface ITaskGraph<TV,TE>public boolean removeAllTaskVertices(java.util.Collection<? extends TV> taskVertices)
removeAllTaskVertices in interface ITaskGraph<TV,TE>public java.util.Set<TE> removeAllTaskEdges(TV sourceTaskVertex, TV targetTaskVertex)
removeAllTaskEdges in interface ITaskGraph<TV,TE>public DirectedEdge<TV,TE> getDataflowTaskEdge(TE taskEdge)
public boolean validate()
protected void validateTaskVertex(TV taskVertex)
public boolean hasCycle()
public abstract void build()