jdsl.map.ref
Class FaceIteratorAdapter

java.lang.Object
  |
  +--jdsl.map.ref.FaceIteratorAdapter
All Implemented Interfaces:
FaceIterator, ObjectIterator, PositionIterator

public class FaceIteratorAdapter
extends java.lang.Object
implements FaceIterator

Takes an ObjectIterator known to be iterating over things that are Faces, and makes it appear as a FaceIterator.

Version:
$Id: FaceIteratorAdapter.java,v 1.1 2000/11/03 02:31:30 lv Exp $
Author:
Mark Handy, Luca Vismara

Constructor Summary
FaceIteratorAdapter(ObjectIterator oi)
           
 
Method Summary
 java.lang.Object element()
          Shortcut for position().element().
 Face face()
           
 boolean hasNext()
           
 Face nextFace()
           
 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

FaceIteratorAdapter

public FaceIteratorAdapter(ObjectIterator oi)
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

nextFace

public Face nextFace()
Specified by:
nextFace in interface FaceIterator
Following copied from interface: jdsl.map.api.FaceIterator
Returns:
Next face to consider
Throws:
java.util.NoSuchElementException - if iterator has moved past the last face 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

face

public Face face()
Specified by:
face in interface FaceIterator
Following copied from interface: jdsl.map.api.FaceIterator
Returns:
The face returned by the most recent successful nextFace()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-face 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