예제 #1
1
 /**
  * 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));
 }
예제 #2
1
 public static Array<Double> rangeBy(double from, double toExclusive, double step) {
   return ofAll(Iterator.rangeBy(from, toExclusive, step));
 }
예제 #3
1
 /**
  * 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));
 }
예제 #4
1
 public static Array<Character> rangeBy(char from, char toExclusive, int step) {
   return ofAll(Iterator.rangeBy(from, toExclusive, step));
 }