public class TimePeriodValue extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
Constructor and Description |
---|
TimePeriodValue(TimePeriod period,
double value)
Constructs a new data item.
|
TimePeriodValue(TimePeriod period,
java.lang.Number value)
Constructs a new data item.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
toString()
Returns a string representing this instance, primarily for use in
debugging.
|
public TimePeriodValue(TimePeriod period, java.lang.Number value)
period
- the time period (null
not permitted).value
- the value associated with the time period.java.lang.IllegalArgumentException
- if period
is
null
.public TimePeriodValue(TimePeriod period, double value)
period
- the time period (null
not permitted).value
- the value associated with the time period.java.lang.IllegalArgumentException
- if period
is
null
.public TimePeriod getPeriod()
null
).public java.lang.Number getValue()
null
).setValue(Number)
public void setValue(java.lang.Number value)
value
- the new value (null
permitted).getValue()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object (null
permitted).public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
Note: no need to clone the period or value since they are immutable classes.
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object