Package com.jfcbuilder.builders
Class XYTimeSeriesBuilder
java.lang.Object
com.jfcbuilder.builders.XYTimeSeriesBuilder
- All Implemented Interfaces:
IXYTimeSeriesBuilder<XYTimeSeriesBuilder>
public class XYTimeSeriesBuilder
extends Object
implements IXYTimeSeriesBuilder<XYTimeSeriesBuilder>
Builder for producing TimeSeries instances from configured properties and source data.
-
Method Summary
Modifier and TypeMethodDescriptionorg.jfree.data.time.TimeSeriesbuild()Builds a new TimeSeries instance from all data and settings supplied to this builder.color()Gets the cached color to be used for drawing the series.Sets the color used to draw series that is built.data(double[] data) Sets the data value array to be plotted.static XYTimeSeriesBuilderget()Factory method for obtaining new instances of this class.indexRange(ZeroBasedIndexRange indexRange) Sets zero-based data indexing range (start index and end index) to be used.Sets the name associated with the series.showTimeGaps(boolean showTimeGaps) Toggle whether to show time gaps at x-values where there is no corresponding time instance.style()Gets the cached style to be used for drawing the series.Sets the Stroke ("style") used to draw series that is built.timeData(long[] timeData) Sets the time data array associated with various other data to be plotted.toString()
-
Method Details
-
get
Factory method for obtaining new instances of this class.- Returns:
- New instance of this class
-
name
Description copied from interface:IXYTimeSeriesBuilderSets the name associated with the series.- Specified by:
namein interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Parameters:
name- The name to be set- Returns:
- Reference to this builder for chaining method calls
-
indexRange
Description copied from interface:IXYTimeSeriesBuilderSets zero-based data indexing range (start index and end index) to be used. By using this range, implementations can iterate over this particular sub-set of elements in the data array and clients do not have to copy their data simply to provide the proper set of data starting at index zero and ending at (length - 1). This should reduce memory usage and computational overhead.- Specified by:
indexRangein interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Parameters:
indexRange- The data array indexing range to be set- Returns:
- Reference to this builder for chaining method calls
-
data
Description copied from interface:IXYTimeSeriesBuilderSets the data value array to be plotted.- Specified by:
datain interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Parameters:
data- The value data to be set. Warning: this array's length must be equal to the length of the associated time series array set via ITimeSeriesBuilder.timeData(long[]). Failure to do so will result in undefined and possibly fatal behavior.- Returns:
- Reference to this builder for chaining method calls
-
timeData
Description copied from interface:IXYTimeSeriesBuilderSets the time data array associated with various other data to be plotted. The array should define all time instances in milliseconds since the epoch start.- Specified by:
timeDatain interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Parameters:
timeData- The time data to be set. Warning: this array's length must be equal to the length of all other data to be plotted that will be associated with this time series. Failure to do so will result in undefined and possibly fatal behavior.- Returns:
- Reference to this builder for chaining method calls
-
showTimeGaps
Description copied from interface:IXYTimeSeriesBuilderToggle whether to show time gaps at x-values where there is no corresponding time instance.- Specified by:
showTimeGapsin interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Parameters:
showTimeGaps- True to show time gaps, false otherwise.- Returns:
- Reference to this builder instance for method chaining
-
color
Description copied from interface:IXYTimeSeriesBuilderSets the color used to draw series that is built. This is not used explicitly by this builder but is associated with the built series so is cached in the builder as a convenience for lookup in a subsequent step after ITimeSeriesBuilder.build() is called.- Specified by:
colorin interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Parameters:
color- The color to be used when the series is drawn- Returns:
- Reference to this builder for chaining method calls
-
color
Description copied from interface:IXYTimeSeriesBuilderGets the cached color to be used for drawing the series.- Specified by:
colorin interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Returns:
- The series drawing color
-
style
Description copied from interface:IXYTimeSeriesBuilderSets the Stroke ("style") used to draw series that is built. This is not used explicitly by this builder but is associated with the built series so is cached in the builder as a convenience for lookup in a subsequent step after ITimeSeriesBuilder.build() is called.- Specified by:
stylein interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Parameters:
stroke- The stroke defining the XY line style to be used when the series is drawn- Returns:
- Reference to this builder for chaining method calls
-
style
Description copied from interface:IXYTimeSeriesBuilderGets the cached style to be used for drawing the series.- Specified by:
stylein interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Returns:
- The series drawing style
-
toString
-
build
Description copied from interface:IXYTimeSeriesBuilderBuilds a new TimeSeries instance from all data and settings supplied to this builder.- Specified by:
buildin interfaceIXYTimeSeriesBuilder<XYTimeSeriesBuilder>- Returns:
- The new TimeSeries instance if successful
- Throws:
IllegalStateException- If the builder was not setup adequately to properly create new TimeSeries instances
-