org.jfree.data.time
Class TimePeriodValues

java.lang.Object
  |
  +--org.jfree.data.Series
        |
        +--org.jfree.data.time.TimePeriodValues
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class TimePeriodValues
extends Series
implements java.io.Serializable

See Also:
Serialized Form

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.
 void delete(int start, int end)
          Deletes data from start until end index (end inclusive).
 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.
 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.
 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.Series
addChangeListener, addPropertyChangeListener, clone, firePropertyChange, fireSeriesChanged, getDescription, getName, notifyListeners, removeChangeListener, removePropertyChangeListener, setDescription, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DOMAIN_DESCRIPTION

protected static final java.lang.String DEFAULT_DOMAIN_DESCRIPTION
Default value for the domain description.

See Also:
Constant Field Values

DEFAULT_RANGE_DESCRIPTION

protected static final java.lang.String DEFAULT_RANGE_DESCRIPTION
Default value for the range description.

See Also:
Constant Field Values
Constructor Detail

TimePeriodValues

public TimePeriodValues(java.lang.String name)
Creates a new (empty) collection of time period values.

Parameters:
name - the name of the series.

TimePeriodValues

public TimePeriodValues(java.lang.String name,
                        java.lang.String domain,
                        java.lang.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.
domain - the domain description.
range - the range description.
Method Detail

getDomainDescription

public java.lang.String getDomainDescription()
Returns the domain description.

Returns:
the domain description.

setDomainDescription

public void setDomainDescription(java.lang.String description)
Sets the domain description.

A property change event is fired, and an undoable edit is posted.

Parameters:
description - the new description.

getRangeDescription

public java.lang.String getRangeDescription()
Returns the range description.

Returns:
the range description.

setRangeDescription

public void setRangeDescription(java.lang.String description)
Sets the range description.

Registered listeners are notified of the change.

Parameters:
description - the new description.

getItemCount

public int getItemCount()
Returns the number of items in the series.

Returns:
the item count.

getDataItem

public TimePeriodValue getDataItem(int index)
Returns one data item for the series.

Parameters:
index - the item index (zero-based).
Returns:
one data item for the series.

getTimePeriod

public TimePeriod getTimePeriod(int index)
Returns the time period at the specified index.

Parameters:
index - the index of the data pair.
Returns:
the time period at the specified index.

getValue

public java.lang.Number getValue(int index)
Returns the value at the specified index.

Parameters:
index - index of a value.
Returns:
the value at the specified index.

add

public void add(TimePeriodValue item)
         throws SeriesException
Adds a data item to the series.

Throws:
SeriesException - if there is a problem adding the data.

add

public void add(TimePeriod period,
                double value)
         throws SeriesException
Adds a new data item to the series.

Parameters:
period - the time period.
value - the value.
Throws:
SeriesException - if there is a problem adding the data.

add

public void add(TimePeriod period,
                java.lang.Number value)
         throws SeriesException
Adds a new data item to the series.

Parameters:
period - the time period.
value - the value.
Throws:
SeriesException - if there is a problem adding the data.

update

public void update(int index,
                   java.lang.Number value)
Updates (changes) the value of a data item.

Parameters:
index - the index of the data item to update.
value - the new value.

delete

public void delete(int start,
                   int end)
Deletes data from start until end index (end inclusive).

Parameters:
start - the index of the first period to delete.
end - the index of the last period to delete.