Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jfree.data.time
Class TimePeriodValue

    java.lang.Object
      org.jfree.data.time.TimePeriodValue

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable

    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 item.
`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 (`null` not permitted).
    `value` - the value associated with the time period.
  Throws:
    `java.lang.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:
    `java.lang.IllegalArgumentException` - if `period` is `null`.

Method Detail

### getPeriod

    public TimePeriod getPeriod()

  Returns the time period.

  Returns:
    The time period (never `null`).

### getValue

    public java.lang.Number getValue()

  Returns the value.

  Returns:
    The value (possibly `null`).
  See Also:
    `setValue(Number)`

### setValue

    public void setValue(java.lang.Number value)

  Sets the value for this data item.

  Parameters:
    `value` - the new value (`null` permitted).
  See Also:
    `getValue()`

### equals

    public boolean equals(java.lang.Object obj)

  Tests this object for equality with the target object.

  Overrides:
    `equals` in class `java.lang.Object`
  Parameters:
    `obj` - the object (`null` permitted).
  Returns:
    A boolean.

### hashCode

    public int hashCode()

  Returns a hash code value for the object.

  Overrides:
    `hashCode` in class `java.lang.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.

  Overrides:
    `clone` in class `java.lang.Object`
  Returns:
    A clone.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD