Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.data.general.Series
org.jfree.data.time.TimePeriodValues
TimePeriodValue
instances.
The time periods can overlap, and are maintained in the order that they are
added to the collection.
This is similar to the TimeSeries
class, except that the time
periods can have irregular lengths.
Field Summary | |
protected static String |
|
protected static String |
|
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
Object |
|
TimePeriodValues |
|
void |
|
boolean |
|
TimePeriodValue |
|
String |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
String |
|
TimePeriod |
|
Number |
|
int |
|
void |
|
void |
|
void |
|
Methods inherited from class org.jfree.data.general.Series | |
addChangeListener , addPropertyChangeListener , clone , equals , firePropertyChange , fireSeriesChanged , getDescription , getKey , getNotify , hashCode , notifyListeners , removeChangeListener , removePropertyChangeListener , setDescription , setKey , setNotify |
protected static final String DEFAULT_DOMAIN_DESCRIPTION
Default value for the domain description.
protected static final String DEFAULT_RANGE_DESCRIPTION
Default value for the range description.
public TimePeriodValues(String name)
Creates a new (empty) collection of time period values.
- Parameters:
name
- the name of the series (null
not permitted).
public TimePeriodValues(String name, String domain, String range)
Creates a new time series that contains no data. Descriptions can be specified for the domain and range. One situation where this is helpful is when generating a chart for the time series - axis labels can be taken from the domain and range description.
- Parameters:
name
- the name of the series (null
not permitted).domain
- the domain description.range
- the range description.
public void add(TimePeriod period, Number value)
Adds a new data item to the series and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
period
- the time period (null
not permitted).value
- the value (null
permitted).
public void add(TimePeriod period, double value)
Adds a new data item to the series and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
period
- the time period (null
not permitted).value
- the value.
- See Also:
add(TimePeriod,Number)
public void add(TimePeriodValue item)
Adds a data item to the series and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
item
- the item (null
not permitted).
public Object clone() throws CloneNotSupportedException
Returns a clone of the collection. Notes:
- no need to clone the domain and range descriptions, since String object is immutable;
- we pass over to the more general method createCopy(start, end).
- Returns:
- A clone of the time series.
public TimePeriodValues createCopy(int start, int end) throws CloneNotSupportedException
Creates a new instance by copying a subset of the data in this collection.
- Parameters:
start
- the index of the first item to copy.end
- the index of the last item to copy.
- Returns:
- A copy of a subset of the items.
public void delete(int start, int end)
Deletes data from start until end index (end inclusive) and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
start
- the index of the first period to delete.end
- the index of the last period to delete.
public boolean equals(Object obj)
Tests the series for equality with another object.
- Parameters:
obj
- the object (null
permitted).
- Returns:
true
orfalse
.
public TimePeriodValue getDataItem(int index)
Returns one data item for the series.
- Parameters:
index
- the item index (in the range0
togetItemCount() - 1
).
- Returns:
- One data item for the series.
public String getDomainDescription()
Returns the domain description.
- Returns:
- The domain description (possibly
null
).
public int getItemCount()
Returns the number of items in the series.
- Returns:
- The item count.
public int getMaxEndIndex()
Returns the index of the time period with the maximum end milliseconds.
- Returns:
- The index.
public int getMaxMiddleIndex()
Returns the index of the time period with the maximum middle milliseconds.
- Returns:
- The index.
public int getMaxStartIndex()
Returns the index of the time period with the maximum start milliseconds.
- Returns:
- The index.
public int getMinEndIndex()
Returns the index of the time period with the minimum end milliseconds.
- Returns:
- The index.
public int getMinMiddleIndex()
Returns the index of the time period with the minimum middle milliseconds.
- Returns:
- The index.
public int getMinStartIndex()
Returns the index of the time period with the minimum start milliseconds.
- Returns:
- The index.
public String getRangeDescription()
Returns the range description.
- Returns:
- The range description (possibly
null
).
public TimePeriod getTimePeriod(int index)
Returns the time period at the specified index.
- Parameters:
index
- the item index (in the range0
togetItemCount() - 1
).
- Returns:
- The time period at the specified index.
- See Also:
getDataItem(int)
public Number getValue(int index)
Returns the value at the specified index.
- Parameters:
index
- the item index (in the range0
togetItemCount() - 1
).
- Returns:
- The value at the specified index (possibly
null
).
- See Also:
getDataItem(int)
public void setDomainDescription(String description)
Sets the domain description and fires a property change event (with the property nameDomain
if the description changes).
- Parameters:
description
- the new description (null
permitted).
- See Also:
getDomainDescription()
public void setRangeDescription(String description)
Sets the range description and fires a property change event with the nameRange
.
- Parameters:
description
- the new description (null
permitted).
- See Also:
getRangeDescription()
public void update(int index, Number value)
Updates (changes) the value of a data item and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
index
- the index of the data item to update.value
- the new value (null
not permitted).