Class LongRange

    • Method Detail

      • min

        public long min()
        Return the minimum value of the long range.
        Returns:
        the minimum value of the long range
      • max

        public long max()
        Return the maximum value of the long range.
        Returns:
        the maximum value of the long range
      • stream

        public LongStream stream()
        Returns a sequential ordered LongStream from min() (inclusive) to max() (exclusive) by an incremental step of 1.

        An equivalent sequence of increasing values can be produced sequentially using a for loop as follows:

        for (long i = range.min(); i < range.max(); ++i) { ... }
        Returns:
        a sequential LongStream for the range of long elements
        Since:
        3.4
      • of

        public static LongRange of​(long min,
                                   long max)
        Create a new LongRange object with the given min and max values.
        Parameters:
        min - the lower bound of the long range
        max - the upper bound of the long range
        Returns:
        a new LongRange object
        Throws:
        IllegalArgumentException - if min > max
      • of

        public static LongRange of​(long value)
        Return a new (half open) range, which contains only the given value: [value, value + 1).
        Parameters:
        value - the value of the created (half open) integer range
        Returns:
        a new (half open) range, which contains only the given value
        Since:
        4.0