|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.isi.pegasus.planner.partitioner.graph.TopologicalSortIterator
public class TopologicalSortIterator
Does a topological sort on the Partition.
| Field Summary | |
|---|---|
private Graph |
mGraph
The partition that has to be sorted. |
private int[] |
mInDegree
An array that contains the number of incoming edges to a node. |
private Map |
mIndexMap
A Map that returns the index into mInDegree map for a particular node in graph. |
private int |
mOrder
The number of nodes in the graph. |
private List<GraphNode> |
mQueue
The internal list of nodes that contains the nodes to be traversed. |
| Constructor Summary | |
|---|---|
TopologicalSortIterator(Graph graph)
The overloaded constructor. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
Returns whether there are more nodes to be traversed in the graph or not. |
private int |
index(String id)
Returns the index of a particular node. |
void |
initialize()
Initializes the inDegree for each node of the partition. |
Object |
next()
Returns the next node to be traversed |
void |
remove()
Removes a node from the graph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Graph mGraph
private int[] mInDegree
private Map mIndexMap
mInDegreeprivate List<GraphNode> mQueue
private int mOrder
| Constructor Detail |
|---|
public TopologicalSortIterator(Graph graph)
p - the graph that has to be sorted.| Method Detail |
|---|
public void initialize()
public boolean hasNext()
hasNext in interface Iteratorpublic Object next()
next in interface Iteratorpublic void remove()
remove in interface Iteratorprivate int index(String id)
id - the id of the node.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||