public class

TimePeriodValue

extends Object
implements Serializable Cloneable
java.lang.Object
   ↳ org.jfree.data.time.TimePeriodValue

Class Overview

Represents a time period and an associated value.

Summary

Public Constructors
TimePeriodValue(TimePeriod period, Number value)
Constructs a new data item.
TimePeriodValue(TimePeriod period, double value)
Constructs a new data item.
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

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.

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.

Public Methods

public Object clone ()

Clones the object.

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

Returns
  • A clone.

public boolean equals (Object obj)

Tests this object for equality with the target object.

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

public TimePeriod getPeriod ()

Returns the time period.

Returns
  • The time period (never null).

public Number getValue ()

Returns the value.

Returns
  • The value (possibly null).
See Also

public int hashCode ()

Returns a hash code value for the object.

Returns
  • The hashcode

public void setValue (Number value)

Sets the value for this data item.

Parameters
value the new value (null permitted).
See Also

public String toString ()

Returns a string representing this instance, primarily for use in debugging.

Returns
  • A string.