T - public final class DefaultGraph<T extends Comparable<T>> extends Object implements Graph<T>
Graph.Node<T>| Constructor and Description |
|---|
DefaultGraph() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDependency(T evalFirstNode,
T evalLaterNode)
Should add the two nodes in the datastructure in such a way that
evalFirstValue should be evaluated before evalAfterValue. |
void |
addIndependent(T nodeValue)
Adds the given node to the datastructure whith out any dependency
Nodes should be created only if it is not already added.
|
Collection<Graph.Node<T>> |
allNodes()
Returns all nodes in this graph
|
Set<Graph.Node<T>> |
getInitialNodes()
Returns the Set of nodes for which there is no incoming dependencies.
|
Set<Graph.Node<T>> |
getLeafNodes()
Retruns the set of nodes for which there is no outgoing dependencies.
|
int |
size()
Returns the total number of nodes in this graph
|
public void addIndependent(T nodeValue)
GraphaddIndependent in interface Graph<T extends Comparable<T>>public void addDependency(T evalFirstNode, T evalLaterNode)
GraphevalFirstValue should be evaluated before evalAfterValue.
Nodes should be created only if it is not already added.addDependency in interface Graph<T extends Comparable<T>>public Set<Graph.Node<T>> getInitialNodes()
GraphgetInitialNodes in interface Graph<T extends Comparable<T>>public int size()
Graphsize in interface Graph<T extends Comparable<T>>public Collection<Graph.Node<T>> allNodes()
GraphallNodes in interface Graph<T extends Comparable<T>>public Set<Graph.Node<T>> getLeafNodes()
GraphgetLeafNodes in interface Graph<T extends Comparable<T>>Copyright © 2016 Dexecutor. All rights reserved.