nz.ac.waikato.jdsl.graph.ref
Class EdgeIteratorAdapter

java.lang.Object
  extended by nz.ac.waikato.jdsl.graph.ref.EdgeIteratorAdapter
All Implemented Interfaces:
ObjectIterator, PositionIterator, EdgeIterator

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:
JDSL 2.1.1
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
Returns:
Whether there is at least one object still unseen

nextObject

public java.lang.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 java.lang.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 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
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


Copyright © 2009 ModelJUnit Project. All Rights Reserved.