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

All Implemented Interfaces:
    Serializable, Cloneable

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
static final  long serialVersionUID    For serialization. 
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. 
Constructor:
 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.
Method from org.jfree.data.time.TimePeriodValues Summary:
add,   add,   add,   clone,   createCopy,   delete,   equals,   getDataItem,   getDomainDescription,   getItemCount,   getMaxEndIndex,   getMaxMiddleIndex,   getMaxStartIndex,   getMinEndIndex,   getMinMiddleIndex,   getMinStartIndex,   getRangeDescription,   getTimePeriod,   getValue,   hashCode,   setDomainDescription,   setRangeDescription,   update
Methods from org.jfree.data.general.Series:
addChangeListener,   addPropertyChangeListener,   clone,   equals,   firePropertyChange,   fireSeriesChanged,   getDescription,   getItemCount,   getKey,   getNotify,   hashCode,   isEmpty,   notifyListeners,   removeChangeListener,   removePropertyChangeListener,   setDescription,   setKey,   setNotify
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.data.time.TimePeriodValues Detail:
 public  void add(TimePeriodValue item) 
    Adds a data item to the series and sends a SeriesChangeEvent to all registered listeners.
 public  void add(TimePeriod period,
    double value) 
    Adds a new data item to the series and sends a SeriesChangeEvent to all registered listeners.
 public  void add(TimePeriod period,
    Number value) 
    Adds a new data item to the series and sends a SeriesChangeEvent to all registered listeners.
 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).
 public TimePeriodValues createCopy(int start,
    int end) throws CloneNotSupportedException 
    Creates a new instance by copying a subset of the data in this collection.
 public  void delete(int start,
    int end) 
    Deletes data from start until end index (end inclusive) and sends a SeriesChangeEvent to all registered listeners.
 public boolean equals(Object obj) 
    Tests the series for equality with another object.
 public TimePeriodValue getDataItem(int index) 
    Returns one data item for the series.
 public String getDomainDescription() 
    Returns the domain description.
 public int getItemCount() 
    Returns the number of items in the series.
 public int getMaxEndIndex() 
    Returns the index of the time period with the maximum end milliseconds.
 public int getMaxMiddleIndex() 
    Returns the index of the time period with the maximum middle milliseconds.
 public int getMaxStartIndex() 
    Returns the index of the time period with the maximum start milliseconds.
 public int getMinEndIndex() 
    Returns the index of the time period with the minimum end milliseconds.
 public int getMinMiddleIndex() 
    Returns the index of the time period with the minimum middle milliseconds.
 public int getMinStartIndex() 
    Returns the index of the time period with the minimum start milliseconds.
 public String getRangeDescription() 
    Returns the range description.
 public TimePeriod getTimePeriod(int index) 
    Returns the time period at the specified index.
 public Number getValue(int index) 
    Returns the value at the specified index.
 public int hashCode() 
    Returns a hash code value for the object.
 public  void setDomainDescription(String description) 
    Sets the domain description and fires a property change event (with the property name Domain if the description changes).
 public  void setRangeDescription(String description) 
    Sets the range description and fires a property change event with the name Range.
 public  void update(int index,
    Number value) 
    Updates (changes) the value of a data item and sends a SeriesChangeEvent to all registered listeners.