Package org.jfree.data.time
Class TimePeriodValue
java.lang.Object
org.jfree.data.time.TimePeriodValue
- All Implemented Interfaces:
Serializable
,Cloneable
public class TimePeriodValue extends Object implements Cloneable, Serializable
Represents a time period and an associated value.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description TimePeriodValue(TimePeriod period, double value)
Constructs a new data item.TimePeriodValue(TimePeriod period, Number value)
Constructs a new data item. -
Method Summary
Modifier and Type Method Description Object
clone()
Clones the object.boolean
equals(Object obj)
Tests this object for equality with the target object.TimePeriod
getPeriod()
Returns the time period.Number
getValue()
Returns the value.int
hashCode()
Returns a hash code value for the object.void
setValue(Number value)
Sets the value for this data item.String
toString()
Returns a string representing this instance, primarily for use in debugging.
-
Constructor Details
-
TimePeriodValue
Constructs a new data item.- Parameters:
period
- the time period (null
not permitted).value
- the value associated with the time period.- Throws:
IllegalArgumentException
- ifperiod
isnull
.
-
TimePeriodValue
Constructs a new data item.- Parameters:
period
- the time period (null
not permitted).value
- the value associated with the time period.- Throws:
IllegalArgumentException
- ifperiod
isnull
.
-
-
Method Details
-
getPeriod
Returns the time period.- Returns:
- The time period (never
null
).
-
getValue
Returns the value.- Returns:
- The value (possibly
null
). - See Also:
setValue(Number)
-
setValue
Sets the value for this data item.- Parameters:
value
- the new value (null
permitted).- See Also:
getValue()
-
equals
Tests this object for equality with the target object. -
hashCode
Returns a hash code value for the object. -
clone
Clones the object.Note: no need to clone the period or value since they are immutable classes.
-
toString
Returns a string representing this instance, primarily for use in debugging.
-