|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.data.TimeSeriesDataPair
Represents one data item in a time series.
The time period can be any of the following: Year, Quarter, Month, Week, Day, Hour, Minute, Second or Millisecond.
The time period is an immutable property of the data pair. Data pairs will often be sorted within a list, and allowing the time period to be changed could destroy the sort order.
Implements the Comparable interface so that standard Java sorting can be used to keep the data pairs in order.
Constructor Summary | |
TimeSeriesDataPair(TimePeriod period,
double value)
Constructs a new data pair. |
|
TimeSeriesDataPair(TimePeriod period,
java.lang.Number value)
Constructs a new data pair. |
Method Summary | |
java.lang.Object |
clone()
Clones the data pair. |
int |
compareTo(java.lang.Object o1)
Returns an integer indicating the order of this data pair object relative to another object. |
TimePeriod |
getPeriod()
Returns the time period. |
java.lang.Number |
getValue()
Returns the value. |
void |
setValue(java.lang.Number value)
Sets the value for this data pair. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TimeSeriesDataPair(TimePeriod period, java.lang.Number value)
period
- the time period.value
- the value associated with the time period.public TimeSeriesDataPair(TimePeriod period, double value)
period
- the time period.value
- the value associated with the time period.Method Detail |
public java.lang.Object clone()
Notes: --> no need to clone the period or value since they are immutable classes.
clone
in class java.lang.Object
public TimePeriod getPeriod()
public java.lang.Number getValue()
public void setValue(java.lang.Number value)
value
- the new value.public int compareTo(java.lang.Object o1)
For the order we consider only the timing: negative == before, zero == same, positive == after.
compareTo
in interface java.lang.Comparable
o1
- The object being compared to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |