org.jfree.data.time
Class TimePeriodValue

java.lang.Object
  extended byorg.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.

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 object.
 boolean equals(java.lang.Object obj)
          Tests this object for equality with the target object.
 TimePeriod getPeriod()
          Returns the time period.
 java.lang.Number getValue()
          Returns the value.
 int hashCode()
          Returns a hash code value for the object.
 void setValue(java.lang.Number value)
          Sets the value for this data item.
 
Methods inherited from class java.lang.Object
finalize, getClass, 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

getPeriod

public TimePeriod getPeriod()
Returns the time period.

Returns:
The time period.

getValue

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

Returns:
The value (possibly null).

setValue

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

Parameters:
value - the new value (null permitted).

equals

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

Parameters:
obj - the object (null permitted).
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code value for the object.

Returns:
The hashcode

clone

public java.lang.Object clone()
Clones the object.

Note: no need to clone the period or value since they are immutable classes.

Returns:
A clone.