Class Interval


  • public class Interval
    extends java.lang.Object
    Utility class for interval related constants and methods. An interval consists of a begin and end value indicating the start and end of the interval. Both value are inclusive, eg (1,2) is an interval of size 2. There are 3 types of interval; normal, ZStar1 and ZStar2. Normal intervals have begin value in 16 MSB and end in 16 LSB. ZStar1 intervals have end value in 16 MSB and begin in 16 LSB. ZStar2 intervals have only an end value located at 16 LSB.
    Author:
    Magnar Nedland, bjorncs
    • Method Detail

      • fromBoundaries

        public static int fromBoundaries​(int begin,
                                         int end)
      • fromZStar1Boundaries

        public static int fromZStar1Boundaries​(int begin,
                                               int end)
      • fromZStar2Boundaries

        public static int fromZStar2Boundaries​(int end)
      • isZStar1Interval

        public static boolean isZStar1Interval​(int interval)
      • isZStar2Interval

        public static boolean isZStar2Interval​(int interval)
      • getBegin

        public static int getBegin​(int interval)
      • getEnd

        public static int getEnd​(int interval)
      • getZStar1Begin

        public static int getZStar1Begin​(int interval)
      • getZStar1End

        public static int getZStar1End​(int interval)
      • getZStar2End

        public static int getZStar2End​(int interval)
      • combineZStarIntervals

        public static int combineZStarIntervals​(int zStar1,
                                                int zStar2)
        Returns:
        A new ZStar1 interval with boundaries [end(zStar1)+1, end(zStar2)]