Class FreshnessRange

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public final class FreshnessRange
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    A range for a Freshness field expression.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FreshnessRange clone()
      boolean equals​(java.lang.Object other)
      double getConstant()
      Gets the constant y-intercept, or the c in ax^2 + bx + c.
      double getLinear()
      Sets the linear coefficient, or the b in ax^2 + bx + c.
      long getMaxDelta()
      Gets the max delta in timeUnits from the table's center that the range applies to.
      double getQuadratic()
      Gets the quadratic coefficient, or the a in ax^2 + bx + c.
      TimeResolution getResolution()
      Gets the TimeUnit of the start & end deltas
      int hashCode()
      void setConstant​(double value)
      Gets the constant y-intercept, or the c in ax^2 + bx + c.
      void setLinear​(double value)
      Sets the linear coefficient, or the b in ax^2 + bx + c.
      void setMaxDelta​(long maxDelta)
      Gets the max delta in timeUnits from the table's center that the range applies to.
      void setQuadratic​(double value)
      Sets the quadratic coefficient, or the a in ax^2 + bx + c.
      void setResolution​(TimeResolution value)
      Sets the time resolution of the start & end deltas
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_RESOLUTION

        public static final TimeResolution DEFAULT_RESOLUTION
        Default time resolution for this range.
    • Constructor Detail

      • FreshnessRange

        public FreshnessRange()
      • FreshnessRange

        public FreshnessRange​(long maxDelta)
      • FreshnessRange

        public FreshnessRange​(long maxAge,
                              double a,
                              double b,
                              double c)
      • FreshnessRange

        public FreshnessRange​(long maxAge,
                              TimeResolution timeUnit,
                              double a,
                              double b,
                              double c)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getMaxDelta

        public long getMaxDelta()
        Gets the max delta in timeUnits from the table's center that the range applies to.
      • setMaxDelta

        public void setMaxDelta​(long maxDelta)
        Gets the max delta in timeUnits from the table's center that the range applies to.
      • getQuadratic

        public double getQuadratic()
        Gets the quadratic coefficient, or the a in ax^2 + bx + c.
      • setQuadratic

        public void setQuadratic​(double value)
        Sets the quadratic coefficient, or the a in ax^2 + bx + c.
      • getLinear

        public double getLinear()
        Sets the linear coefficient, or the b in ax^2 + bx + c.

        This is the slope if the quadratic coefficient is zero.

      • setLinear

        public void setLinear​(double value)
        Sets the linear coefficient, or the b in ax^2 + bx + c.
      • getConstant

        public double getConstant()
        Gets the constant y-intercept, or the c in ax^2 + bx + c.

        This is the static boost if the quadratic and linear coefficients are zero.

      • setConstant

        public void setConstant​(double value)
        Gets the constant y-intercept, or the c in ax^2 + bx + c.
      • getResolution

        public TimeResolution getResolution()
        Gets the TimeUnit of the start & end deltas
      • setResolution

        public void setResolution​(TimeResolution value)
        Sets the time resolution of the start & end deltas
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • clone

        public FreshnessRange clone()
        Overrides:
        clone in class java.lang.Object