Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.xy.AbstractIntervalXYDataset
org.jfree.data.time.DynamicTimeSeriesCollection
public class DynamicTimeSeriesCollection
extends AbstractIntervalXYDataset
implements IntervalXYDataset, DomainInfo, RangeInfo
Nested Class Summary | |
protected class |
|
Field Summary | |
static int |
|
static int |
|
static int |
|
protected int |
|
protected RegularTimePeriod[] |
|
protected DynamicTimeSeriesCollection.ValueSequence[] |
|
protected Calendar |
|
Constructor Summary | |
| |
| |
| |
|
Method Summary | |
void |
|
void |
|
RegularTimePeriod |
|
void |
|
void |
|
protected void |
|
protected double |
|
protected void |
|
Range |
|
double |
|
double |
|
Number |
|
Number |
|
int |
|
int |
|
RegularTimePeriod |
|
int |
|
RegularTimePeriod |
|
int |
|
Range |
|
double |
|
double |
|
int |
|
Comparable |
|
Number |
|
Number |
|
Number |
|
Number |
|
double |
|
void |
|
int |
|
int |
|
void |
|
void |
|
long |
|
protected int |
|
protected int |
|
Methods inherited from class org.jfree.data.xy.AbstractIntervalXYDataset | |
getEndXValue , getEndYValue , getStartXValue , getStartYValue |
Methods inherited from class org.jfree.data.xy.AbstractXYDataset | |
getDomainOrder , getXValue , getYValue |
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset | |
getSeriesCount , getSeriesKey , indexOf , seriesChanged |
Methods inherited from class org.jfree.data.general.AbstractDataset | |
addChangeListener , clone , fireDatasetChanged , getGroup , hasListener , notifyListeners , removeChangeListener , setGroup , validateObject |
public static final int END
Useful constant for controlling the x-value returned for a time period.
- Field Value:
- 2
public static final int MIDDLE
Useful constant for controlling the x-value returned for a time period.
- Field Value:
- 1
public static final int START
Useful constant for controlling the x-value returned for a time period.
- Field Value:
- 0
protected DynamicTimeSeriesCollection.ValueSequence[] valueHistory
An array for storing the objects that represent each series.
public DynamicTimeSeriesCollection(int nSeries, int nMoments)
Constructs a dataset with capacity for N series, tied to default timezone.
- Parameters:
nSeries
- the number of series to be accommodated.nMoments
- the number of TimePeriods to be spanned.
public DynamicTimeSeriesCollection(int nSeries, int nMoments, TimeZone zone)
Constructs an empty dataset, tied to a specific timezone.
- Parameters:
nSeries
- the number of series to be accommodatednMoments
- the number of TimePeriods to be spannedzone
- the timezone.
public DynamicTimeSeriesCollection(int nSeries, int nMoments, RegularTimePeriod timeSample)
Creates a new dataset.
- Parameters:
nSeries
- the number of series.nMoments
- the number of items per series.timeSample
- a time period sample.
public DynamicTimeSeriesCollection(int nSeries, int nMoments, RegularTimePeriod timeSample, TimeZone zone)
Creates a new dataset.
- Parameters:
nSeries
- the number of series.nMoments
- the number of items per series.timeSample
- a time period sample.zone
- the time zone.
public void addSeries(float[] values, int seriesNumber, Comparable seriesKey)
Adds a series to the dataset. Only the y-values are supplied, the x-values are specified elsewhere.
- Parameters:
values
- the y-values.seriesNumber
- the series index (zero-based).seriesKey
- the series key. Use this as-is during setup only, or add the synchronized keyword around the copy loop.
public void addValue(int seriesNumber, int index, float value)
Adds a value to a series.
- Parameters:
seriesNumber
- the series index.index
- ??.value
- the value.
public RegularTimePeriod advanceTime()
Adjust the array offset as needed when a new time-period is added: Increments the indices "oldestAt" and "newestAt", mod(array length), zeroes the series values at newestAt, returns the new TimePeriod.
- Returns:
- The new time period.
public void appendData(float[] newData, int insertionIndex, int refresh)
Appends data at specified index, for loading up with data from file(s).
- Parameters:
newData
- the datainsertionIndex
- the index value at which to put itrefresh
- value of n in "refresh the display on every nth call" (ignored if <= 0 )
protected void findDomainLimits()
Finds the domain limits. Note: this doesn't need to be synchronized because it's called from within another method that already is.
protected void fireSeriesChanged()
Sends aSeriesChangeEvent
to all registered listeners.
public Range getDomainBounds(boolean includeInterval)
Returns the range of the values in this dataset's domain.
- Specified by:
- getDomainBounds in interface DomainInfo
- Parameters:
includeInterval
- a flag that determines whether or not the x-interval is taken into account.
- Returns:
- The range.
public double getDomainLowerBound(boolean includeInterval)
Returns the minimum x-value in the dataset.
- Specified by:
- getDomainLowerBound in interface DomainInfo
- Parameters:
includeInterval
- a flag that determines whether or not the x-interval is taken into account.
- Returns:
- The minimum value.
public double getDomainUpperBound(boolean includeInterval)
Returns the maximum x-value in the dataset.
- Specified by:
- getDomainUpperBound in interface DomainInfo
- Parameters:
includeInterval
- a flag that determines whether or not the x-interval is taken into account.
- Returns:
- The maximum value.
public Number getEndX(int series, int item)
Returns the end x-value.
- Specified by:
- getEndX in interface IntervalXYDataset
- Parameters:
series
- the series index (zero-based).item
- the item index (zero-based).
- Returns:
- The value.
public Number getEndY(int series, int item)
Returns the end y-value.
- Specified by:
- getEndY in interface IntervalXYDataset
- Parameters:
series
- the series index (zero-based).item
- the item index (zero-based).
- Returns:
- The value.
public int getItemCount(int series)
Returns the number of items in a series. For this implementation, all series have the same number of items.
- Specified by:
- getItemCount in interface XYDataset
- Parameters:
series
- the series index (zero-based).
- Returns:
- The item count.
public int getNewestIndex()
Returns the index of the newest data item.
- Returns:
- The index.
public RegularTimePeriod getNewestTime()
Returns the newest time.
- Returns:
- The newest time.
public int getOldestIndex()
Returns the index of the oldest data item.
- Returns:
- The index.
public RegularTimePeriod getOldestTime()
Returns the oldest time.
- Returns:
- The oldest time.
public int getPosition()
Returns the x position type (START, MIDDLE or END).
- Returns:
- The x position type.
public Range getRangeBounds(boolean includeInterval)
Returns the value range.
- Specified by:
- getRangeBounds in interface RangeInfo
- Parameters:
includeInterval
- a flag that determines whether or not the y-interval is taken into account.
- Returns:
- The range.
public double getRangeLowerBound(boolean includeInterval)
Returns the minimum range value.
- Specified by:
- getRangeLowerBound in interface RangeInfo
- Parameters:
includeInterval
- a flag that determines whether or not the y-interval is taken into account.
- Returns:
- The minimum range value.
public double getRangeUpperBound(boolean includeInterval)
Returns the maximum range value.
- Specified by:
- getRangeUpperBound in interface RangeInfo
- Parameters:
includeInterval
- a flag that determines whether or not the y-interval is taken into account.
- Returns:
- The maximum range value.
public int getSeriesCount()
Returns the number of series in the collection.
- Specified by:
- getSeriesCount in interface SeriesDataset
- Overrides:
- getSeriesCount in interface AbstractSeriesDataset
- Returns:
- The series count.
public Comparable getSeriesKey(int series)
Returns the key for a series.
- Specified by:
- getSeriesKey in interface SeriesDataset
- Overrides:
- getSeriesKey in interface AbstractSeriesDataset
- Parameters:
series
- the series index (zero-based).
- Returns:
- The key.
public Number getStartX(int series, int item)
Returns the start x-value.
- Specified by:
- getStartX in interface IntervalXYDataset
- Parameters:
series
- the series index (zero-based).item
- the item index (zero-based).
- Returns:
- The value.
public Number getStartY(int series, int item)
Returns the start y-value.
- Specified by:
- getStartY in interface IntervalXYDataset
- Parameters:
series
- the series index (zero-based).item
- the item index (zero-based).
- Returns:
- The value.
public Number getX(int series, int item)
Returns the x-value.
- Parameters:
series
- the series index (zero-based).item
- the item index (zero-based).
- Returns:
- The value.
public Number getY(int series, int item)
Returns the y-value.
- Parameters:
series
- the series index (zero-based).item
- the item index (zero-based).
- Returns:
- The value.
public double getYValue(int series, int item)
Returns the y-value.
- Overrides:
- getYValue in interface AbstractXYDataset
- Parameters:
series
- the series index (zero-based).item
- the item index (zero-based).
- Returns:
- The value.
public int offsetFromNewest(int delta)
Returns the actual index to a time offset by "delta" from newestAt.
- Parameters:
delta
- the delta.
- Returns:
- The offset.
public void setPosition(int position)
Sets the x position type (START, MIDDLE or END).
- Parameters:
position
- The x position type.
public void setSeriesKey(int seriesNumber, Comparable key)
Sets the name of a series. If planning to add values individually.
- Parameters:
seriesNumber
- the series.key
- the new key.
public long setTimeBase(RegularTimePeriod start)
Fill the pointsInTime with times using TimePeriod.next(): Will silently return if the time array was already populated. Also computes the data cached for later use by methods implementing the DomainInfo interface:
- Parameters:
start
- the start.
- Returns:
- ??.
protected int translateGet(int toFetch)
Re-map an index, for use in retrieving data.
- Parameters:
toFetch
- the index.
- Returns:
- The translated index.
protected int wrapOffset(int protoIndex)
??
- Parameters:
protoIndex
- the index.
- Returns:
- The offset.