JML

org.jmlspecs.jmlunit.strategies
Class FloatAbstractFilteringIteratorDecorator

java.lang.Object
  extended byorg.jmlspecs.jmlunit.strategies.FloatAbstractIterator
      extended byorg.jmlspecs.jmlunit.strategies.FloatAbstractFilteringIteratorDecorator
All Implemented Interfaces:
Cloneable, FloatIterator, IndefiniteIterator
Direct Known Subclasses:
FloatAbstractFilteringStrategyDecorator.NewIter, FloatNonNegativeIteratorDecorator

public abstract class FloatAbstractFilteringIteratorDecorator
extends FloatAbstractIterator

An filtering decorator for an indefinite iterator over type float.

Author:
Gary T. Leavens

Field Summary
private  FloatIterator rawElems
           
 
Constructor Summary
FloatAbstractFilteringIteratorDecorator(FloatIterator iter)
          Initialize this iterator decorator
FloatAbstractFilteringIteratorDecorator(FloatIterator iter, float ignored)
          Partially intialize this iterator decorator, with a call to initialize needed after this call.
 
Method Summary
 void advance()
          Advance the state of this iteration to the next position.
abstract  boolean approve(float elem)
          Return true if the element is to be returned by the getFloat() method.
 boolean atEnd()
          Is this iterator at its end?
 Object clone()
          Return a copy of this iterator in the same state as this object.
 float getFloat()
          Return the current approved element.
 void initialize()
          Complete initialization of this object.
private  void setCursor()
          Set the cursor to the next element that is approved, if any.
 String toString()
           
 
Methods inherited from class org.jmlspecs.jmlunit.strategies.FloatAbstractIterator
get
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rawElems

private FloatIterator rawElems
Constructor Detail

FloatAbstractFilteringIteratorDecorator

public FloatAbstractFilteringIteratorDecorator(FloatIterator iter)
Initialize this iterator decorator


FloatAbstractFilteringIteratorDecorator

public FloatAbstractFilteringIteratorDecorator(FloatIterator iter,
                                               float ignored)
Partially intialize this iterator decorator, with a call to initialize needed after this call.

Method Detail

initialize

public void initialize()
Complete initialization of this object.


setCursor

private void setCursor()
Set the cursor to the next element that is approved, if any.


approve

public abstract boolean approve(float elem)
Return true if the element is to be returned by the getFloat() method.


atEnd

public boolean atEnd()
Description copied from interface: IndefiniteIterator
Is this iterator at its end? That is, if we called get(), would it throw an exception?


getFloat

public float getFloat()
               throws NoSuchElementException
Return the current approved element.

Throws:
NoSuchElementException

advance

public void advance()
Description copied from interface: IndefiniteIterator
Advance the state of this iteration to the next position. Note that this never throws an exception.


clone

public Object clone()
Description copied from interface: FloatIterator
Return a copy of this iterator in the same state as this object.

Specified by:
clone in interface FloatIterator
Overrides:
clone in class FloatAbstractIterator

toString

public String toString()
Overrides:
toString in class Object

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.