Class Interpolator

    • Constructor Detail

      • Interpolator

        public Interpolator()
    • Method Detail

      • createDiscreteInterpolator

        public static Interpolator createDiscreteInterpolator()
      • createAnalogInterpolator

        public static Interpolator createAnalogInterpolator()
      • update

        public void update​(HistoricalValue value)
                    throws java.lang.IllegalArgumentException
        Adds the value to the interpolator. Values must go foward in time, and an exception will be thrown if a value is added out of order.
        Throws:
        java.lang.IllegalArgumentException - if the incoming value has a timestamp less than a previously added value.
      • getValueAt

        public ProcessedValue getValueAt​(long timestamp)
                                  throws java.lang.IllegalArgumentException
        Returns the (potentially) interpolated value at the time. Note that the timestamp must always be later than previous requests! Time must only move forward.
        Throws:
        java.lang.IllegalArgumentException - if the time requested is before a previously requested time. All requests must go forward.
      • valueFor

        protected ProcessedValue valueFor​(java.lang.Object value,
                                          QualityCode qual,
                                          long ts,
                                          boolean provisional)
        Returns interpolated processed value.
      • valueFor

        protected ProcessedValue valueFor​(java.lang.Object value,
                                          QualityCode qual,
                                          long ts,
                                          boolean provisional,
                                          boolean interpolated)
      • needsDoubles

        protected abstract boolean needsDoubles()
      • interpolate

        protected abstract ProcessedValue interpolate​(long timestamp)
        "A" or "B" can be null, but the situation will be A < timestamp < B, if present.
      • interpolateDiscrete

        protected ProcessedValue interpolateDiscrete​(long timestamp)
      • interpolateLinear

        protected ProcessedValue interpolateLinear​(long timestamp)