org.spaceroots.mantissa.functions.scalar
Class BasicSampledFunctionIterator

java.lang.Object
  extended byorg.spaceroots.mantissa.functions.scalar.BasicSampledFunctionIterator
All Implemented Interfaces:
SampledFunctionIterator, Serializable

public class BasicSampledFunctionIterator
extends Object
implements SampledFunctionIterator, Serializable

This class is a simple wrapper allowing to iterate over a SampledFunction.

The basic implementation of the iteration interface does not perform any transformation on the sample, it only handles a loop over the underlying sampled function.

Version:
$Id: BasicSampledFunctionIterator.java 1686 2005-12-16 12:59:51Z luc $
Author:
L. Maisonobe
See Also:
SampledFunction, Serialized Form

Constructor Summary
BasicSampledFunctionIterator(SampledFunction function)
          Simple constructor.
 
Method Summary
 boolean hasNext()
          Check if the iterator can provide another point.
 ScalarValuedPair nextSamplePoint()
          Get the next point of a sampled function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSampledFunctionIterator

public BasicSampledFunctionIterator(SampledFunction function)
Simple constructor. Build an instance from a SampledFunction

Parameters:
function - smapled function over which we want to iterate
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: SampledFunctionIterator
Check if the iterator can provide another point.

Specified by:
hasNext in interface SampledFunctionIterator
Returns:
true if the iterator can provide another point.

nextSamplePoint

public ScalarValuedPair nextSamplePoint()
                                 throws ExhaustedSampleException,
                                        FunctionException
Description copied from interface: SampledFunctionIterator
Get the next point of a sampled function.

Specified by:
nextSamplePoint in interface SampledFunctionIterator
Returns:
the next point of the sampled function
Throws:
FunctionException - if the underlying function throws one
ExhaustedSampleException - if the sample has been exhausted


Copyright © 2001-2007 Luc Maisonobe. All Rights Reserved.