Package com.jfcbuilder.builders
Interface IXYTimeSeriesBuilder<T extends IXYTimeSeriesBuilder<T>>
- Type Parameters:
T
- The method chaining return type, which must be the type of the builder implementing this interface.
- All Known Implementing Classes:
XYTimeSeriesBuilder
public interface IXYTimeSeriesBuilder<T extends IXYTimeSeriesBuilder<T>>
Interface for all XYTimeSeries builders. Uses a generic to specify the concrete implementation of
the interface as the return type of setter methods. This is done to support method chaining on
the same builder instance. In this framework there can be different builder types that have
specialized methods. If the return types were made to be this interface instead of the concrete
class then those specialized methods of the classes not defined in the interface would be hidden
by only having access to the interface.
-
Method Summary
Modifier and TypeMethodDescriptionorg.jfree.data.time.TimeSeries
build()
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.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.
-
Method Details
-
name
Sets the name associated with the series.- Parameters:
name
- The name to be set- Returns:
- Reference to this builder for chaining method calls
-
indexRange
Sets 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.- Parameters:
indexRange
- The data array indexing range to be set- Returns:
- Reference to this builder for chaining method calls
-
data
Sets the data value array to be plotted.- 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
-
color
Sets 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.- Parameters:
color
- The color to be used when the series is drawn- Returns:
- Reference to this builder for chaining method calls
-
color
Color color()Gets the cached color to be used for drawing the series.- Returns:
- The series drawing color
-
style
Sets 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.- 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
Stroke style()Gets the cached style to be used for drawing the series.- Returns:
- The series drawing style
-
timeData
Sets 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.- 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
Toggle whether to show time gaps at x-values where there is no corresponding time instance.- Parameters:
showTimeGaps
- True to show time gaps, false otherwise.- Returns:
- Reference to this builder instance for method chaining
-
build
Builds a new TimeSeries instance from all data and settings supplied to this builder.- Returns:
- The new TimeSeries instance if successful
- Throws:
IllegalStateException
- If the builder was not setup adequately to properly create new TimeSeries instances
-