java.lang.Object
org.elasticsearch.xpack.core.ml.utils.Intervals
A collection of utilities related to intervals
-
Method Summary
Modifier and TypeMethodDescriptionstatic longalignToCeil(long value, long interval) Aligns avalueto a multiple of anintervalby rounding up.static longalignToFloor(long value, long interval) Aligns avalueto a multiple of anintervalby rounding down.
-
Method Details
-
alignToFloor
public static long alignToFloor(long value, long interval) Aligns avalueto a multiple of anintervalby rounding down.- Parameters:
value- the value to align to a multiple of theintervalinterval- the interval- Returns:
- the multiple of the
intervalthat is less or equal to thevalue
-
alignToCeil
public static long alignToCeil(long value, long interval) Aligns avalueto a multiple of anintervalby rounding up.- Parameters:
value- the value to align to a multiple of theintervalinterval- the interval- Returns:
- the multiple of the
intervalthat is greater or equal to thevalue
-