Save This Page
Home » jcommon-1.0.13 » org.jfree » data » time » [javadoc | source]
org.jfree.data.time
public class: TimeSeriesDataItem [javadoc | source]
java.lang.Object
   org.jfree.data.time.TimeSeriesDataItem

All Implemented Interfaces:
    Cloneable, Serializable, Comparable

Represents one data item in a time series.

The time period can be any of the following:

The time period is an immutable property of the data item. Data items 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 items in order.
Constructor:
 public TimeSeriesDataItem(RegularTimePeriod period,
    Number value) 
    Constructs a new data item that associates a value with a time period.
    Parameters:
    period - the time period (null not permitted).
    value - the value (null permitted).
 public TimeSeriesDataItem(RegularTimePeriod period,
    double value) 
    Constructs a new data item that associates a value with a time period.
    Parameters:
    period - the time period (null not permitted).
    value - the value associated with the time period.
Method from org.jfree.data.time.TimeSeriesDataItem Summary:
clone,   compareTo,   equals,   getPeriod,   getValue,   hashCode,   setValue
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.data.time.TimeSeriesDataItem Detail:
 public Object clone() 
    Clones the data item. Note: there is no need to clone the period or value since they are immutable classes.
 public int compareTo(Object o1) 
    Returns an integer indicating the order of this data pair object relative to another object.

    For the order we consider only the timing: negative == before, zero == same, positive == after.

 public boolean equals(Object o) 
    Tests this object for equality with an arbitrary object.
 public RegularTimePeriod getPeriod() 
    Returns the time period.
 public Number getValue() 
    Returns the value.
 public int hashCode() 
    Returns a hash code.
 public  void setValue(Number value) 
    Sets the value for this data item.