org.spaceroots.mantissa.functions.scalar
Class BasicSampledFunctionIterator
- java.lang.Object
-
- org.spaceroots.mantissa.functions.scalar.BasicSampledFunctionIterator
-
- All Implemented Interfaces:
- java.io.Serializable, SampledFunctionIterator
public class BasicSampledFunctionIterator extends java.lang.Object implements SampledFunctionIterator, java.io.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.
- See Also:
SampledFunction, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BasicSampledFunctionIterator(SampledFunction function)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanhasNext()Check if the iterator can provide another point.ScalarValuedPairnextSamplePoint()Get the next point of a sampled function.
-
-
-
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:SampledFunctionIteratorCheck if the iterator can provide another point.- Specified by:
hasNextin interfaceSampledFunctionIterator- Returns:
- true if the iterator can provide another point.
-
nextSamplePoint
public ScalarValuedPair nextSamplePoint() throws ExhaustedSampleException, FunctionException
Description copied from interface:SampledFunctionIteratorGet the next point of a sampled function.- Specified by:
nextSamplePointin interfaceSampledFunctionIterator- Returns:
- the next point of the sampled function
- Throws:
ExhaustedSampleException- if the sample has been exhaustedFunctionException- if the underlying function throws one
-
-
DataMelt 3.0 © DataMelt by jWork.ORG