org.jfree.data.time
Class TimePeriodValue

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

public class TimePeriodValue
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Represents a time period and an associated value.

Author:
David Gilbert
See Also:
Serialized Form

Constructor Summary
TimePeriodValue(TimePeriod period, double value)
          Constructs a new data pair.
TimePeriodValue(TimePeriod period, java.lang.Number value)
          Constructs a new data item.
 
Method Summary
 java.lang.Object clone()
          Clones the data pair.
 boolean equals(java.lang.Object target)
          Tests this object for equality with the target 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 item.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimePeriodValue

public TimePeriodValue(TimePeriod period,
                       java.lang.Number value)
Constructs a new data item.

Parameters:
period - the time period.
value - the value associated with the time period.

TimePeriodValue

public TimePeriodValue(TimePeriod period,
                       double value)
Constructs a new data pair.

Parameters:
period - the time period.
value - the value associated with the time period.
Method Detail

clone

public java.lang.Object clone()
Clones the data pair.

Notes: --> no need to clone the period or value since they are immutable classes.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this data pair.

getPeriod

public TimePeriod getPeriod()
Returns the time period.

Returns:
the time period.

getValue

public java.lang.Number getValue()
Returns the value.

Returns:
the value.

setValue

public void setValue(java.lang.Number value)
Sets the value for this data item.

Parameters:
value - the new value.

equals

public boolean equals(java.lang.Object target)
Tests this object for equality with the target object.

Overrides:
equals in class java.lang.Object
Parameters:
target - the other object.
Returns:
A boolean.