org.spaceroots.mantissa.functions.vectorial
Class BasicSampledFunctionIterator

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

public class BasicSampledFunctionIterator
extends Object
implements SampledFunctionIterator, Serializable

This class is a 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
 int getDimension()
          Get the dimension of the vectorial values of the function.
 boolean hasNext()
          Check if the iterator can provide another point.
 VectorialValuedPair 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

getDimension

public int getDimension()
Description copied from interface: SampledFunctionIterator
Get the dimension of the vectorial values of the function.

Specified by:
getDimension in interface SampledFunctionIterator
Returns:
dimension

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 VectorialValuedPair 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:
ExhaustedSampleException - if the sample has been exhausted
FunctionException - if the underlying function throws one


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