net.sourceforge.openforecast
Interface DataPoint

All Known Implementing Classes:
Observation

public interface DataPoint

Defines the interface to a single data point, consisting of one value of a dependent variable, and one or more values of independent variables. Note that a data point can refer to a previously observed data value, or a future forecast value.

Note that in earlier versions DataPoint was defined as a class (not an interface). Therefore any code written using OpenForecast 0.20 or earlier that instantiates DataPoint objects directly will need to be modified. Use the Observation class instead.

Since:
0.3
Author:
Steven R. Gould
See Also:
Observation

Method Summary
 boolean equals(DataPoint dp)
          Compares the given DataPoint object to the current DataPoint object, and returns true if, and only if, the two data points represent the same data point.
 double getDependentValue()
          Returns the current value assigned to the dependent variable.
 double getIndependentValue(String name)
          Returns the current value assigned to the named independent variable.
 String[] getIndependentVariableNames()
          Returns an array of all independent variable names.
 void setDependentValue(double value)
          Sets the dependent variables' value to the given value.
 void setIndependentValue(String name, double value)
          Sets the named independent variables' value to the given value.
 

Method Detail

setDependentValue

void setDependentValue(double value)
Sets the dependent variables' value to the given value.

Parameters:
value - the new value for the dependent variable.

getDependentValue

double getDependentValue()
Returns the current value assigned to the dependent variable. This value can be changed by calling setDependentValue.

Returns:
the current value of the dependent variable.

setIndependentValue

void setIndependentValue(String name,
                         double value)
Sets the named independent variables' value to the given value. Each data point can have one or more name-value pairs that represent the independent variables and their associated values.

Parameters:
value - the new value for the dependent variable.

getIndependentValue

double getIndependentValue(String name)
Returns the current value assigned to the named independent variable. This value can be changed by calling setIndependentValue.

Parameters:
name - the name of the independent variable required.
Returns:
the current value of the named independent variable.

getIndependentVariableNames

String[] getIndependentVariableNames()
Returns an array of all independent variable names. No checks are made to ensure that the names are unique. Rather, the names are extracted directly from the names used in defining and initializing the data point.

Returns:
an array of independent variable names for this data point.

equals

boolean equals(DataPoint dp)
Compares the given DataPoint object to the current DataPoint object, and returns true if, and only if, the two data points represent the same data point. That is, the dependent value matches for the matching independent values.

Parameters:
dp - the DataPoint to compare this DataPoint object to.
Returns:
true if the given DataPoint object represents the same data point as this DataPoint object.


OpenForecast, Copyright (c) Steven Gould, 2002-2011