jdsl.graph.ref
Class EdgeIteratorAdapter

java.lang.Object
  extended byjdsl.graph.ref.EdgeIteratorAdapter
All Implemented Interfaces:
EdgeIterator, ObjectIterator, PositionIterator

public class EdgeIteratorAdapter
extends Object
implements EdgeIterator

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

Version:
JDSL 2.1.1
Author:
Mark Handy

Constructor Summary
EdgeIteratorAdapter(ObjectIterator pi)
           
 
Method Summary
 Edge edge()
           
 Object element()
          Shortcut for position().element().
 boolean hasNext()
           
 Edge nextEdge()
           
 Object nextObject()
           
 Position nextPosition()
           
 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
Returns:
Whether there is at least one object still unseen

nextObject

public Object nextObject()
Specified by:
nextObject in interface ObjectIterator
Returns:
Next object to consider

nextPosition

public Position nextPosition()
Specified by:
nextPosition in interface PositionIterator
Returns:
Next position to consider

nextEdge

public Edge nextEdge()
Specified by:
nextEdge in interface EdgeIterator
Returns:
Next edge to consider

object

public Object object()
Specified by:
object in interface ObjectIterator
Returns:
The object returned by the most recent next()

position

public Position position()
Specified by:
position in interface PositionIterator
Returns:
The position returned by the most recent next()

edge

public Edge edge()
Specified by:
edge in interface EdgeIterator
Returns:
The edge returned by the most recent next()

element

public Object element()
Description copied from interface: PositionIterator
Shortcut for position().element(). Same as the inherited object() method.

Specified by:
element in interface PositionIterator
Returns:
Element of the position that would be returned by position()

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