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

    • TimePeriodValue

      public TimePeriodValue​(TimePeriod period, Number value)
      Constructs a new data item.
      Parameters:
      period - the time period.
      value - the value associated with the time period.
    • TimePeriodValue

      public TimePeriodValue​(TimePeriod period, double value)
      Constructs a new data pair.
      Parameters:
      period - the time period.
      value - the value associated with the time period.
  • Method Details

    • getPeriod

      public TimePeriod getPeriod()
      Returns the time period.
      Returns:
      the time period.
    • getValue

      public Number getValue()
      Returns the value.
      Returns:
      the value.
    • setValue

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

      public boolean equals​(Object o)
      Tests this object for equality with the target object.
      Overrides:
      equals in class Object
      Parameters:
      o - the other object.
      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 data pair.

      Notes: --> no need to clone the period or value since they are immutable classes.

      Returns:
      a clone of this data pair.