Java Iterator.rangeClosed Examples

Java Iterator.rangeClosed - 4 examples found. These are the top rated real world Java examples of java.util.Iterator.rangeClosed 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 toInclusive}.
  *
  * <p>Examples:
  *
  * <pre>
  * <code>
  * Array.rangeClosed(0L, 0L)  // = Array(0L)
  * Array.rangeClosed(2L, 0L)  // = Array()
  * Array.rangeClosed(-2L, 2L) // = Array(-2L, -1L, 0L, 1L, 2L)
  * </code>
  * </pre>
  *
  * @param from the first number
  * @param toInclusive the last number
  * @return a range of long values as specified or the empty range if {@code from > toInclusive}
  */
 public static Array<Long> rangeClosed(long from, long toInclusive) {
   return ofAll(Iterator.rangeClosed(from, toInclusive));
 }
Example #2
0
 public static Array<Character> rangeClosed(char from, char toInclusive) {
   return ofAll(Iterator.rangeClosed(from, toInclusive));
 }
Example #3
0
 /**
  * Creates a Array of int numbers starting from {@code from}, extending to {@code toInclusive}.
  *
  * <p>Examples:
  *
  * <pre>
  * <code>
  * Array.rangeClosed(0, 0)  // = Array(0)
  * Array.rangeClosed(2, 0)  // = Array()
  * Array.rangeClosed(-2, 2) // = Array(-2, -1, 0, 1, 2)
  * </code>
  * </pre>
  *
  * @param from the first number
  * @param toInclusive the last number
  * @return a range of int values as specified or the empty range if {@code from > toInclusive}
  */
 public static Array<Integer> rangeClosed(int from, int toInclusive) {
   return ofAll(Iterator.rangeClosed(from, toInclusive));
 }
Example #4
0
 /**
  * Creates a Vector of long numbers starting from {@code from}, extending to {@code toInclusive}.
  *
  * <p>Examples:
  *
  * <pre>
  * <code>
  * Vector.rangeClosed(0L, 0L)  // = Vector(0L)
  * Vector.rangeClosed(2L, 0L)  // = Vector()
  * Vector.rangeClosed(-2L, 2L) // = Vector(-2L, -1L, 0L, 1L, 2L)
  * </code>
  * </pre>
  *
  * @param from the first number
  * @param toInclusive the last number
  * @return a range of long values as specified or the empty range if {@code from > toInclusive}
  */
 public static Vector<Long> rangeClosed(long from, long toInclusive) {
   return Vector.ofAll(Iterator.rangeClosed(from, toInclusive));
 }