org.jfree.data.time

Class TimePeriodValue

public class TimePeriodValue extends Object implements Cloneable, Serializable

Represents a time period and an associated value.
Constructor Summary
TimePeriodValue(TimePeriod period, Number value)
Constructs a new data item.
TimePeriodValue(TimePeriod period, double value)
Constructs a new data item.
Method Summary
Objectclone()
Clones the object.
booleanequals(Object obj)
Tests this object for equality with the target object.
TimePeriodgetPeriod()
Returns the time period.
NumbergetValue()
Returns the value.
inthashCode()
Returns a hash code value for the object.
voidsetValue(Number value)
Sets the value for this data item.
StringtoString()
Returns a string representing this instance, primarily for use in debugging.

Constructor Detail

TimePeriodValue

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

Parameters: period the time period (null not permitted). value the value associated with the time period.

Throws: IllegalArgumentException if period is null.

TimePeriodValue

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

Parameters: period the time period (null not permitted). value the value associated with the time period.

Throws: IllegalArgumentException if period is null.

Method Detail

clone

public Object clone()
Clones the object.

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

Returns: A clone.

equals

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

Parameters: obj the object (null permitted).

Returns: A boolean.

getPeriod

public TimePeriod getPeriod()
Returns the time period.

Returns: The time period (never null).

getValue

public Number getValue()
Returns the value.

Returns: The value (possibly null).

See Also: setValue

hashCode

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

Returns: The hashcode

setValue

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

Parameters: value the new value (null permitted).

See Also: getValue

toString

public String toString()
Returns a string representing this instance, primarily for use in debugging.

Returns: A string.

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.