com.enterprisemath.math.statistics.observation.ObservationIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of em-math Show documentation
Show all versions of em-math Show documentation
Advanced mathematical algorithms.
The newest version!
package com.enterprisemath.math.statistics.observation;
import java.util.NoSuchElementException;
/**
* Defines functionality of the observation iterator.
* Simply iterates through the list of observations.
* Once iteration is done, then it cannot be taken back.
*
* @author radek.hecl
*
* @param type of the observation
*/
public interface ObservationIterator {
/**
* Returns whether the next observation is available or not.
*
* @return true if the next observation is available
*/
public boolean isNextAvailable();
/**
* Returns the next observation.
*
* @return next the next observation
* @throws NoSuchElementException if there is not any more observation available
*/
public T getNext();
/**
* Returns the number of observations which were already iterated through.
* Note this value is equal to the total number of elements in sequence
* if next observation is not available.
*
* @return number of observations which were iterated through
*/
public long getNumIterated();
}