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

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

public class VertexIteratorAdapter
extends java.lang.Object
implements VertexIterator

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

Version:
JDSL 2.1.1
Author:
Mark Handy

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

Constructor Detail

VertexIteratorAdapter

public VertexIteratorAdapter(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

nextVertex

public Vertex nextVertex()
Specified by:
nextVertex in interface VertexIterator
Returns:
Next vertex 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()

vertex

public Vertex vertex()
Specified by:
vertex in interface VertexIterator
Returns:
The vertex 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.