java.lang.Object
org.elasticsearch.xpack.core.ml.utils.Intervals

public class Intervals extends Object
A collection of utilities related to intervals
  • Method Details

    • alignToFloor

      public static long alignToFloor(long value, long interval)
      Aligns a value to a multiple of an interval by rounding down.
      Parameters:
      value - the value to align to a multiple of the interval
      interval - the interval
      Returns:
      the multiple of the interval that is less or equal to the value
    • alignToCeil

      public static long alignToCeil(long value, long interval)
      Aligns a value to a multiple of an interval by rounding up.
      Parameters:
      value - the value to align to a multiple of the interval
      interval - the interval
      Returns:
      the multiple of the interval that is greater or equal to the value