Java Iterator.rangeBy Examples

Java Iterator.rangeBy - 4 examples found. These are the top rated real world Java examples of java.util.Iterator.rangeBy extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 /**
  * Creates a Array of long numbers starting from {@code from}, extending to {@code toExclusive -
  * 1}, with {@code step}.
  *
  * <p>Examples:
  *
  * <pre>
  * <code>
  * Array.rangeBy(1L, 3L, 1L)  // = Array(1L, 2L)
  * Array.rangeBy(1L, 4L, 2L)  // = Array(1L, 3L)
  * Array.rangeBy(4L, 1L, -2L) // = Array(4L, 2L)
  * Array.rangeBy(4L, 1L, 2L)  // = Array()
  * </code>
  * </pre>
  *
  * @param from the first number
  * @param toExclusive the last number + 1
  * @param step the step
  * @return a range of long values as specified or the empty range if<br>
  *     {@code from >= toInclusive} and {@code step > 0} or<br>
  *     {@code from <= toInclusive} and {@code step < 0}
  * @throws IllegalArgumentException if {@code step} is zero
  */
 public static Array<Long> rangeBy(long from, long toExclusive, long step) {
   return ofAll(Iterator.rangeBy(from, toExclusive, step));
 }
Example #2
0
 public static Array<Double> rangeBy(double from, double toExclusive, double step) {
   return ofAll(Iterator.rangeBy(from, toExclusive, step));
 }
Example #3
0
 /**
  * Creates a Array of int numbers starting from {@code from}, extending to {@code toExclusive -
  * 1}, with {@code step}.
  *
  * <p>Examples:
  *
  * <pre>
  * <code>
  * Array.rangeBy(1, 3, 1)  // = Array(1, 2)
  * Array.rangeBy(1, 4, 2)  // = Array(1, 3)
  * Array.rangeBy(4, 1, -2) // = Array(4, 2)
  * Array.rangeBy(4, 1, 2)  // = Array()
  * </code>
  * </pre>
  *
  * @param from the first number
  * @param toExclusive the last number + 1
  * @param step the step
  * @return a range of long values as specified or the empty range if<br>
  *     {@code from >= toInclusive} and {@code step > 0} or<br>
  *     {@code from <= toInclusive} and {@code step < 0}
  * @throws IllegalArgumentException if {@code step} is zero
  */
 public static Array<Integer> rangeBy(int from, int toExclusive, int step) {
   return ofAll(Iterator.rangeBy(from, toExclusive, step));
 }
Example #4
0
 public static Array<Character> rangeBy(char from, char toExclusive, int step) {
   return ofAll(Iterator.rangeBy(from, toExclusive, step));
 }