Class TimeSeriesDataItem

    • Constructor Detail

      • TimeSeriesDataItem

        public TimeSeriesDataItem​(RegularTimePeriod period,
                                  Number value)
        Constructs a new data item that associates a value with a time period.
        Parameters:
        period - the time period (null not permitted).
        value - the value (null permitted).
      • TimeSeriesDataItem

        public TimeSeriesDataItem​(RegularTimePeriod period,
                                  double value)
        Constructs a new data item that associates a value with a time period.
        Parameters:
        period - the time period (null not permitted).
        value - the value associated with the time period.
    • Method Detail

      • getPeriod

        public RegularTimePeriod getPeriod()
        Returns the time period.
        Returns:
        The time period (never null).
      • setValue

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

        public boolean equals​(Object obj)
        Tests this object for equality with an arbitrary object.
        Overrides:
        equals in class Object
        Parameters:
        obj - the other object (null permitted).
        Returns:
        A boolean.
      • hashCode

        public int hashCode()
        Returns a hash code.
        Overrides:
        hashCode in class Object
        Returns:
        A hash code.
      • compareTo

        public int compareTo​(Object o1)
        Returns an integer indicating the order of this data pair object relative to another object.

        For the order we consider only the timing: negative == before, zero == same, positive == after.

        Specified by:
        compareTo in interface Comparable
        Parameters:
        o1 - The object being compared to.
        Returns:
        An integer indicating the order of the data item object relative to another object.
      • clone

        public Object clone()
        Clones the data item. Note: there is no need to clone the period or value since they are immutable classes.
        Overrides:
        clone in class Object
        Returns:
        A clone of the data item.