Class IntervalUtils


  • public final class IntervalUtils
    extends java.lang.Object
    This is a utility class for common behaviors between Interval and IntInterval. It is a public class only because Interval and IntInterval are in different packages.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private IntervalUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int binarySearch​(long value, long from, long to, long step)  
      static void checkArguments​(long from, long to, long stepBy)  
      private static void checkSize​(long from, long to, long stepBy)  
      private static void checkStepBy​(long from, long to, long stepBy)  
      static boolean contains​(long value, long from, long to, long step)  
      static int indexOf​(long value, long from, long to, long step)  
      static int intSize​(long from, long to, long step)  
      static boolean isWithinBoundaries​(long value, long from, long to, long step)  
      static long valueAtIndex​(int index, long from, long to, long step)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntervalUtils

        private IntervalUtils()
    • Method Detail

      • checkArguments

        public static void checkArguments​(long from,
                                          long to,
                                          long stepBy)
      • checkSize

        private static void checkSize​(long from,
                                      long to,
                                      long stepBy)
      • checkStepBy

        private static void checkStepBy​(long from,
                                        long to,
                                        long stepBy)
      • intSize

        public static int intSize​(long from,
                                  long to,
                                  long step)
      • contains

        public static boolean contains​(long value,
                                       long from,
                                       long to,
                                       long step)
      • isWithinBoundaries

        public static boolean isWithinBoundaries​(long value,
                                                 long from,
                                                 long to,
                                                 long step)
      • indexOf

        public static int indexOf​(long value,
                                  long from,
                                  long to,
                                  long step)
      • valueAtIndex

        public static long valueAtIndex​(int index,
                                        long from,
                                        long to,
                                        long step)
      • binarySearch

        public static int binarySearch​(long value,
                                       long from,
                                       long to,
                                       long step)