Package com.jfcbuilder.types
Class XYTimeSeriesElements
java.lang.Object
com.jfcbuilder.types.XYTimeSeriesElements
Helper class for storing and accessing properties common to different kinds of XY TimeSeries
builders. Intended for use in composition-type implementations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks to see if all preconditions for building the series are satisfied and throws an exception if not.color()
Gets the color that will be used to render the series.void
Sets the desired color to be used when rendering the series.double[]
data()
Gets the data that will be used for generating the series.void
data
(double[] data) Sets the data that will be used for generating the series.Gets the zero-based index range to be used when generating the series.void
indexRange
(ZeroBasedIndexRange indexRange) Sets the zero-based index range to be used when generating the series.name()
Gets the series name.void
Sets the series name.boolean
Gets whether to render time gaps.void
showTimeGaps
(boolean showTimeGaps) Sets whether or not time gaps should be rendered.style()
Gets the line style to be used when rendering the series.void
Sets the desired line style to be used when rendering the series.long[]
timeData()
Gets the time data that will be used for generating the series.void
timeData
(long[] timeData) Sets the time data that will be used for generating the series.
-
Field Details
-
DEFAULT_STYLE
A default line style to use when rendering if none is specified. -
DEFAULT_COLOR
A default color to use when rendering if none is specified.
-
-
Constructor Details
-
XYTimeSeriesElements
public XYTimeSeriesElements()Constructor.
-
-
Method Details
-
name
Gets the series name.- Returns:
- The series name
-
name
Sets the series name.- Parameters:
name
- The name to be set
-
indexRange
Gets the zero-based index range to be used when generating the series.- Returns:
- The zero-based index range that will be used
-
indexRange
Sets the zero-based index range to be used when generating the series.- Parameters:
indexRange
- The zero-based index range to be set
-
data
public double[] data()Gets the data that will be used for generating the series.- Returns:
- The series data
-
data
public void data(double[] data) Sets the data that will be used for generating the series.- Parameters:
data
- The data to set
-
timeData
public long[] timeData()Gets the time data that will be used for generating the series.- Returns:
- The time data that will be used
-
timeData
public void timeData(long[] timeData) Sets the time data that will be used for generating the series. Values should be in ascending time and represent milliseconds since the epoch start.- Parameters:
timeData
- The time data to be used
-
showTimeGaps
public boolean showTimeGaps()Gets whether to render time gaps.- Returns:
- True if time gaps should be rendered, false otherwise
-
showTimeGaps
public void showTimeGaps(boolean showTimeGaps) Sets whether or not time gaps should be rendered.- Parameters:
showTimeGaps
- True to render time gaps, false otherwise
-
color
Gets the color that will be used to render the series.- Returns:
- The series rendering color
-
color
Sets the desired color to be used when rendering the series. If set to null the default color will be used.- Parameters:
color
- The color to be set
-
style
Gets the line style to be used when rendering the series.- Returns:
- The series rendering line style
-
style
Sets the desired line style to be used when rendering the series. If set to null the default style will be used.- Parameters:
style
- The style to be set
-
checkBuildPreconditions
Checks to see if all preconditions for building the series are satisfied and throws an exception if not.- Throws:
IllegalStateException
- If values data or timeData are null or empty, if values data and timeData lengths aren't equal, or if indexRange defines a range outside of the available data.
-