de.grogra.xl.impl.base
Class EdgeIterator

java.lang.Object
  extended by de.grogra.xl.impl.base.EdgeIterator

public abstract class EdgeIterator
extends java.lang.Object

An EdgeIterator is used to iterate over the edges of a node. It is obtained by Graph#createEdgeIterator and used in the following way:

     for (EdgeIterator i = graph.createEdgeIterator (node); i.hasEdge ();
          i.moveToNext ())
     {
         // i.source contains the source node, i.target the target node,
         // i.edgeBits the edge bits of the current edge
         ...
     }
 

Author:
Ole Kniemeyer

Field Summary
 int edgeBits
          Contains the edge bits of the current edge.
 java.lang.Object source
          Contains the source node of the current edge.
 java.lang.Object target
          Contains the target node of the current edge.
 
Constructor Summary
EdgeIterator()
           
 
Method Summary
abstract  void dispose()
           
abstract  boolean hasEdge()
          Returns true if the fields source, target and edgeBits contain a valid edge.
abstract  void moveToNext()
          Moves the iterator to the next edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

edgeBits

public int edgeBits
Contains the edge bits of the current edge.


source

public java.lang.Object source
Contains the source node of the current edge.


target

public java.lang.Object target
Contains the target node of the current edge.

Constructor Detail

EdgeIterator

public EdgeIterator()
Method Detail

dispose

public abstract void dispose()

hasEdge

public abstract boolean hasEdge()
Returns true if the fields source, target and edgeBits contain a valid edge. Otherwise, it has been iterated over all edges of the node, and this method returns false. Then, further use of this edge iterator is not allowed; the iterator may be re-used by implementations of Graph.

Returns:
true iff this iterator contains a valid edge

moveToNext

public abstract void moveToNext()
Moves the iterator to the next edge. This operation is allowed only when hasEdge() returns true. If there is no next edge left to iterate, hasEdge() will return false afterwards.