Class TimeseriesPoint

    • Field Detail

      • m_DateFormat

        protected static DateFormat m_DateFormat
        for formatting dates.
      • m_Timestamp

        protected Date m_Timestamp
        the teimstamp of the data point.
      • m_Value

        protected double m_Value
        the timeseries value.
    • Constructor Detail

      • TimeseriesPoint

        public TimeseriesPoint()
        Initializes the point with the current date and 0.0 value.
      • TimeseriesPoint

        public TimeseriesPoint​(Date timestamp,
                               double value)
        Initializes the point with the specified timestamp and value.
        Parameters:
        timestamp - the date of the data point
        value - the value of the data point
    • Method Detail

      • getDateFormat

        protected DateFormat getDateFormat()
        Returns the formatter for the timestamps.
        Returns:
        the formatter
      • setTimestamp

        public void setTimestamp​(Date value)
        Sets the timestamp.
        Parameters:
        value - the timestamp
      • getTimestamp

        public Date getTimestamp()
        Returns the timestamp.
        Returns:
        the timestamp
      • setValue

        public void setValue​(double value)
        Sets the value.
        Parameters:
        value - the value
      • getValue

        public double getValue()
        Returns the value.
        Returns:
        the value
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Only uses the timestamp for comparison.
        Specified by:
        compareTo in interface Comparable
        Specified by:
        compareTo in class AbstractDataPoint
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • assign

        public void assign​(DataPoint other)
        Obtains the stored variables from the other data point.
        Specified by:
        assign in interface DataPoint
        Overrides:
        assign in class AbstractDataPoint
        Parameters:
        other - the data point to get the values from
      • toString

        public String toString()
        Returns a string representation of the point.
        Specified by:
        toString in class AbstractDataPoint
        Returns:
        the string representation