|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.data.general.Series
org.jfree.data.time.TimePeriodValues
A structure containing zero, one or many 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 java.lang.String |
DEFAULT_DOMAIN_DESCRIPTION
Default value for the domain description. |
protected static java.lang.String |
DEFAULT_RANGE_DESCRIPTION
Default value for the range description. |
Constructor Summary | |
TimePeriodValues(java.lang.String name)
Creates a new (empty) collection of time period values. |
|
TimePeriodValues(java.lang.String name,
java.lang.String domain,
java.lang.String range)
Creates a new time series that contains no data. |
Method Summary | |
void |
add(TimePeriod period,
double value)
Adds a new data item to the series. |
void |
add(TimePeriod period,
java.lang.Number value)
Adds a new data item to the series. |
void |
add(TimePeriodValue item)
Adds a data item to the series. |
java.lang.Object |
clone()
Returns a clone of the collection. |
TimePeriodValues |
createCopy(int start,
int end)
Creates a new instance by copying a subset of the data in this collection. |
void |
delete(int start,
int end)
Deletes data from start until end index (end inclusive). |
boolean |
equals(java.lang.Object obj)
Tests the series for equality with another object. |
TimePeriodValue |
getDataItem(int index)
Returns one data item for the series. |
java.lang.String |
getDomainDescription()
Returns the domain description. |
int |
getItemCount()
Returns the number of items in the series. |
int |
getMaxEndIndex()
Returns the index of the time period with the maximum end milliseconds. |
int |
getMaxMiddleIndex()
Returns the index of the time period with the maximum middle milliseconds. |
int |
getMaxStartIndex()
Returns the index of the time period with the maximum start milliseconds. |
int |
getMinEndIndex()
Returns the index of the time period with the minimum end milliseconds. |
int |
getMinMiddleIndex()
Returns the index of the time period with the minimum middle milliseconds. |
int |
getMinStartIndex()
Returns the index of the time period with the minimum start milliseconds. |
java.lang.String |
getRangeDescription()
Returns the range description. |
TimePeriod |
getTimePeriod(int index)
Returns the time period at the specified index. |
java.lang.Number |
getValue(int index)
Returns the value at the specified index. |
int |
hashCode()
Returns a hash code value for the object. |
void |
setDomainDescription(java.lang.String description)
Sets the domain description. |
void |
setRangeDescription(java.lang.String description)
Sets the range description. |
void |
update(int index,
java.lang.Number value)
Updates (changes) the value of a data item. |
Methods inherited from class org.jfree.data.general.Series |
addChangeListener, addPropertyChangeListener, firePropertyChange, fireSeriesChanged, getDescription, getName, getNotify, notifyListeners, removeChangeListener, removePropertyChangeListener, setDescription, setName, setNotify |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String DEFAULT_DOMAIN_DESCRIPTION
protected static final java.lang.String DEFAULT_RANGE_DESCRIPTION
Constructor Detail |
public TimePeriodValues(java.lang.String name)
name
- the name of the series.public TimePeriodValues(java.lang.String name, java.lang.String domain, java.lang.String range)
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.
name
- the name of the series.domain
- the domain description.range
- the range description.Method Detail |
public java.lang.String getDomainDescription()
public void setDomainDescription(java.lang.String description)
A property change event is fired, and an undoable edit is posted.
description
- the new description.public java.lang.String getRangeDescription()
public void setRangeDescription(java.lang.String description)
Registered listeners are notified of the change.
description
- the new description.public int getItemCount()
public TimePeriodValue getDataItem(int index)
index
- the item index (zero-based).
public TimePeriod getTimePeriod(int index)
index
- the index of the data pair.
public java.lang.Number getValue(int index)
index
- index of a value.
public void add(TimePeriodValue item)
item
- the (timeperiod, value) pair.public void add(TimePeriod period, double value)
period
- the time period.value
- the value.public void add(TimePeriod period, java.lang.Number value)
period
- the time period.value
- the value.public void update(int index, java.lang.Number value)
index
- the index of the data item to update.value
- the new value.public void delete(int start, int end)
start
- the index of the first period to delete.end
- the index of the last period to delete.public boolean equals(java.lang.Object obj)
equals
in class Series
obj
- the object.
true
or false
.public int hashCode()
hashCode
in class Series
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Notes:
clone
in class Series
java.lang.CloneNotSupportedException
- if there is a cloning problem.public TimePeriodValues createCopy(int start, int end) throws java.lang.CloneNotSupportedException
start
- the index of the first item to copy.end
- the index of the last item to copy.
java.lang.CloneNotSupportedException
- if there is a cloning problem.public int getMinStartIndex()
public int getMaxStartIndex()
public int getMinMiddleIndex()
public int getMaxMiddleIndex()
public int getMinEndIndex()
public int getMaxEndIndex()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |