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:
  • Constructor Details

    • 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 Details

    • 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

      public void setValue(Number value)
      Sets the value for this data item.
      Parameters:
      value - the new value (null permitted).
      See Also:
    • equals

      public boolean equals(Object obj)
      Tests this object for equality with the target object.
      Overrides:
      equals in class 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 Object
      Returns:
      The hashcode
    • clone

      public Object clone()
      Clones the object.

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

      Overrides:
      clone in class Object
      Returns:
      A clone.
    • toString

      public String toString()
      Returns a string representing this instance, primarily for use in debugging.
      Overrides:
      toString in class Object
      Returns:
      A string.