|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.openforecast.input.AbstractBuilder net.sourceforge.openforecast.input.TimeSeriesBuilder
public class TimeSeriesBuilder
Defines a Builder that can be used to construct a DataSet from a TimeSeries object as used/defined by JFreeChart. This class makes for a quick and easy "import" of data from a JFreeChart TimeSeries. Note that since a TimeSeries does not give a name to the independent, time variable, this builder defaults the name to be the class name of the RegularTimePeriod used in the TimeSeries. For example, if a series of org.jfree.data.time.Day objects are used, then the name of the independent variable will default to "Day" (without the quotes).
Constructor Summary | |
---|---|
TimeSeriesBuilder(org.jfree.data.time.TimeSeries timeSeries)
Constructs a new TimeSeriesBuilder that reads its input from the given TimeSeries object. |
|
TimeSeriesBuilder(org.jfree.data.time.TimeSeries timeSeries,
String timeVariableName)
Constructs a new TimeSeriesBuilder that reads its input from the given TimeSeries object. |
Method Summary | |
---|---|
DataSet |
build()
Retrieves a DataSet - a collection of DataPoints - from the current (JFreeChart) TimeSeries. |
String |
getTimeVariable()
Returns the name of the currently defined time variable. |
void |
setTimeVariable(String name)
Used to change the time variable name. |
Methods inherited from class net.sourceforge.openforecast.input.AbstractBuilder |
---|
addVariable, getNumberOfVariables, getVariableName, setNumberOfVariables, setVariableName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeSeriesBuilder(org.jfree.data.time.TimeSeries timeSeries)
timeSeries
- the TimeSeries object containing data to be used to
build the DataSet.
IllegalArgumentException
- if the TimeSeries is empty.public TimeSeriesBuilder(org.jfree.data.time.TimeSeries timeSeries, String timeVariableName)
timeSeries
- the TimeSeries object containing data to be used to
build the DataSet.timeVariableName
- the name to use for the time variable.
IllegalArgumentException
- if the TimeSeries is empty.Method Detail |
---|
public String getTimeVariable()
public void setTimeVariable(String name)
name
- the new name for the time variable.public DataSet build()
In general, build will attempt to convert all values in the TimeSeries to data points.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |