/***********************************************************************
*
* Purpose: COMP2011 Project 1, Session 1 2006
* Topic: Sequence recognition and prediction
* Author: Alan Blair
* Date: March 2006
*
* Note: You should not edit this file;
* you should only edit the following files:
*
* ArithmeticPredictor.java
* GeometricPredictor.java
* QuadraticPredictor.java
* HomogeneousPredictor.java
* RecurrentPredictor.java
*/
public abstract class Predictor {
/**
@return name of the type of sequence.
*/
public abstract String toString();
/**
Process the next item in the sequence.
@param u the next item in the sequence.
*/
public abstract void step( double u );
/**
Test whether the items provided are consistent with this type
of sequence, and if there are enough of them to uniquely predict
the next item in the sequence.
@return true if the next item can be predicted, false otherwise.
*/
public abstract boolean canPredict();
/**
Compute the next item in the sequence and return it;
if the next item cannot be predicted, return zero.
@return next item in the sequence.
*/
public abstract double predict();
}