jdsl.graph.ref
Class EdgeIteratorAdapter

java.lang.Object
  |
  +--jdsl.graph.ref.EdgeIteratorAdapter
All Implemented Interfaces:
EdgeIterator, ObjectIterator, PositionIterator

public class EdgeIteratorAdapter
extends java.lang.Object
implements EdgeIterator

Takes an ObjectIterator known to be iterating over things that are edges, and makes it appear as an EdgeIterator.

Version:
$Id: EdgeIteratorAdapter.java,v 1.1 1999/08/31 21:07:43 mdh Exp $
Author:
Mark Handy

Constructor Summary
EdgeIteratorAdapter(ObjectIterator pi)
           
 
Method Summary
 Edge edge()
           
 java.lang.Object element()
          Shortcut for position().element().
 boolean hasNext()
           
 Edge nextEdge()
           
 java.lang.Object nextObject()
           
 Position nextPosition()
           
 java.lang.Object object()
           
 Position position()
           
 void reset()
          Puts the iterator back in its initial, before-the-first state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeIteratorAdapter

public EdgeIteratorAdapter(ObjectIterator pi)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface ObjectIterator
Following copied from interface: jdsl.core.api.ObjectIterator
Returns:
Whether there is at least one object still unseen

nextObject

public java.lang.Object nextObject()
Specified by:
nextObject in interface ObjectIterator
Following copied from interface: jdsl.core.api.ObjectIterator
Returns:
Next object to consider
Throws:
java.util.NoSuchElementException - if iterator has moved past the last object

nextPosition

public Position nextPosition()
Specified by:
nextPosition in interface PositionIterator
Following copied from interface: jdsl.core.api.PositionIterator
Returns:
Next position to consider
Throws:
java.util.NoSuchElementException - if iterator has moved past the last position to be seen

nextEdge

public Edge nextEdge()
Specified by:
nextEdge in interface EdgeIterator
Following copied from interface: jdsl.graph.api.EdgeIterator
Returns:
Next edge to consider
Throws:
java.util.NoSuchElementException - if iterator has moved past the last edge to be seen

object

public java.lang.Object object()
Specified by:
object in interface ObjectIterator
Following copied from interface: jdsl.core.api.ObjectIterator
Returns:
The object returned by the most recent next()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-object state

position

public Position position()
Specified by:
position in interface PositionIterator
Following copied from interface: jdsl.core.api.PositionIterator
Returns:
The position returned by the most recent next()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-position state

edge

public Edge edge()
Specified by:
edge in interface EdgeIterator
Following copied from interface: jdsl.graph.api.EdgeIterator
Returns:
The edge returned by the most recent next()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-edge state

element

public java.lang.Object element()
Description copied from interface: PositionIterator
Shortcut for position().element(). Same as the inherited object() method.
Specified by:
element in interface PositionIterator
Following copied from interface: jdsl.core.api.PositionIterator
Returns:
Element of the position that would be returned by position()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-position state

reset

public void reset()
Description copied from interface: ObjectIterator
Puts the iterator back in its initial, before-the-first state
Specified by:
reset in interface ObjectIterator