All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enterprisemath.math.statistics.observation.ObservationIterator Maven / Gradle / Ivy

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();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy