logic
Class GraphProcessing.BreadthFirstIterator

java.lang.Object
  extended by logic.GraphProcessing.BreadthFirstIterator
All Implemented Interfaces:
java.util.Iterator<Node>
Enclosing class:
GraphProcessing

public class GraphProcessing.BreadthFirstIterator
extends java.lang.Object
implements java.util.Iterator<Node>

a Breath First Iterator traversing the graph (gernerateTree() has to be called previously)

Author:
Fennes

Constructor Summary
GraphProcessing.BreadthFirstIterator()
           
 
Method Summary
 boolean hasNext()
          returns true if there are remaining nodes in the current generation, else returns false
 boolean hasNextGeneration()
          returns true if the current generation has any children and prepares nextGeneration()
 Node next()
          returns the next node of the current generation
 java.util.LinkedList<Node> nextGeneration()
          returns the next generation and sets this to the current generation.
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphProcessing.BreadthFirstIterator

public GraphProcessing.BreadthFirstIterator()
Method Detail

hasNext

public boolean hasNext()
returns true if there are remaining nodes in the current generation, else returns false

Specified by:
hasNext in interface java.util.Iterator<Node>

next

public Node next()
returns the next node of the current generation

Specified by:
next in interface java.util.Iterator<Node>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<Node>

hasNextGeneration

public boolean hasNextGeneration()
returns true if the current generation has any children and prepares nextGeneration()

Returns:
true if has next generation

nextGeneration

public java.util.LinkedList<Node> nextGeneration()
returns the next generation and sets this to the current generation. allows to proceed with hasNext() and next()

Returns:
Returns the next generation of Nodes in a LinkedList