Plexus v0.13.1

com.phoenixst.plexus.traversals
Class GraphStructureIterator

java.lang.Object
  extended by com.phoenixst.plexus.traversals.GraphStructureIterator
All Implemented Interfaces:
Iterator

public class GraphStructureIterator
extends Object
implements Iterator

An Iterator over the nodes and edges of a Graph ordered such that the endpoints of a Graph.Edge are always seen before the edge itself. This Iterator may be used to build a Graph with the same structure as some specified Graph, even if it has edges which point to other edges.

Since:
1.0
Version:
$Revision: 1.7 $
Author:
Ray A. Conner

Constructor Summary
GraphStructureIterator(Graph graph)
          Creates a new GraphStructureIterator.
 
Method Summary
 boolean hasNext()
           
 boolean isEdge()
          Returns whether or not the last object returned by next() is a Graph.Edge in the Graph.
 boolean isNode()
          Returns whether or not the last object returned by next() is a node in the Graph.
 Object next()
           
 void remove()
          Throws an UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphStructureIterator

public GraphStructureIterator(Graph graph)
Creates a new GraphStructureIterator.

Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
Specified by:
next in interface Iterator

remove

public void remove()
Throws an UnsupportedOperationException.

Specified by:
remove in interface Iterator

isNode

public boolean isNode()
Returns whether or not the last object returned by next() is a node in the Graph.


isEdge

public boolean isEdge()
Returns whether or not the last object returned by next() is a Graph.Edge in the Graph.


Plexus v0.13.1

See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.