net.sourceforge.openforecast
Interface DataPoint
-
- All Known Implementing Classes:
- Observation
public interface DataPointDefines 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
- See Also:
Observation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description booleanequals(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.doublegetDependentValue()Returns the current value assigned to the dependent variable.doublegetIndependentValue(java.lang.String name)Returns the current value assigned to the named independent variable.java.lang.String[]getIndependentVariableNames()Returns an array of all independent variable names.voidsetDependentValue(double value)Sets the dependent variables' value to the given value.voidsetIndependentValue(java.lang.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(java.lang.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(java.lang.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
java.lang.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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG