Class IntegerSequence


  • public class IntegerSequence
    extends java.lang.Object
    Provides a sequence of integers.
    Since:
    3.6
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private IntegerSequence()
      Utility class contains only static methods.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static IntegerSequence.Range range​(int start, int end)
      Creates a sequence [start .. end].
      static IntegerSequence.Range range​(int start, int max, int step)
      Creates a sequence \( a_i, i < 0 <= n \) where \( a_i = start + i * step \) and \( n \) is such that \( a_n <= max \) and \( a_{n+1} > max \).
      • Methods inherited from class java.lang.Object

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

      • IntegerSequence

        private IntegerSequence()
        Utility class contains only static methods.
    • Method Detail

      • range

        public static IntegerSequence.Range range​(int start,
                                                  int end)
        Creates a sequence [start .. end]. It calls range(start, end, 1).
        Parameters:
        start - First value of the range.
        end - Last value of the range.
        Returns:
        a range.
      • range

        public static IntegerSequence.Range range​(int start,
                                                  int max,
                                                  int step)
        Creates a sequence \( a_i, i < 0 <= n \) where \( a_i = start + i * step \) and \( n \) is such that \( a_n <= max \) and \( a_{n+1} > max \).
        Parameters:
        start - First value of the range.
        max - Last value of the range that satisfies the above construction rule.
        step - Increment.
        Returns:
        a range.