Exemplo n.º 1
0
 /**
  * Creates a Array of long numbers starting from {@code from}, extending to {@code toInclusive},
  * with {@code step}.
  *
  * <p>Examples:
  *
  * <pre>
  * <code>
  * Array.rangeClosedBy(1L, 3L, 1L)  // = Array(1L, 2L, 3L)
  * Array.rangeClosedBy(1L, 4L, 2L)  // = Array(1L, 3L)
  * Array.rangeClosedBy(4L, 1L, -2L) // = Array(4L, 2L)
  * Array.rangeClosedBy(4L, 1L, 2L)  // = Array()
  * </code>
  * </pre>
  *
  * @param from the first number
  * @param toInclusive the last number
  * @param step the step
  * @return a range of int 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> rangeClosedBy(long from, long toInclusive, long step) {
   return ofAll(Iterator.rangeClosedBy(from, toInclusive, step));
 }
Exemplo n.º 2
0
 public static Array<Double> rangeClosedBy(double from, double toInclusive, double step) {
   return ofAll(Iterator.rangeClosedBy(from, toInclusive, step));
 }
Exemplo n.º 3
0
 /**
  * Creates a Array of int numbers starting from {@code from}, extending to {@code toInclusive},
  * with {@code step}.
  *
  * <p>Examples:
  *
  * <pre>
  * <code>
  * Array.rangeClosedBy(1, 3, 1)  // = Array(1, 2, 3)
  * Array.rangeClosedBy(1, 4, 2)  // = Array(1, 3)
  * Array.rangeClosedBy(4, 1, -2) // = Array(4, 2)
  * Array.rangeClosedBy(4, 1, 2)  // = Array()
  * </code>
  * </pre>
  *
  * @param from the first number
  * @param toInclusive the last number
  * @param step the step
  * @return a range of int 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> rangeClosedBy(int from, int toInclusive, int step) {
   return ofAll(Iterator.rangeClosedBy(from, toInclusive, step));
 }
Exemplo n.º 4
0
 public static Array<Character> rangeClosedBy(char from, char toInclusive, int step) {
   return ofAll(Iterator.rangeClosedBy(from, toInclusive, step));
 }