Java Iterator.ofAll Examples

Java Iterator.ofAll - 9 examples found. These are the top rated real world Java examples of java.util.Iterator.ofAll extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 @Override
 default <U> Tree<Tuple2<T, U>> zipAll(Iterable<U> that, T thisElem, U thatElem) {
   Objects.requireNonNull(that, "that is null");
   if (isEmpty()) {
     return Iterator.ofAll(that).map(elem -> Tuple.of(thisElem, elem)).toTree();
   } else {
     final java.util.Iterator<U> thatIter = that.iterator();
     final Tree<Tuple2<T, U>> tree = ZipAll.apply((Node<T>) this, thatIter, thatElem);
     if (thatIter.hasNext()) {
       final Iterable<Node<Tuple2<T, U>>> remainder =
           Iterator.ofAll(thatIter).map(elem -> Tree.of(Tuple.of(thisElem, elem)));
       return new Node<>(tree.getValue(), tree.getChildren().appendAll(remainder));
     } else {
       return tree;
     }
   }
 }
Example #2
0
 /**
  * Creates a Array based on the elements of a short array.
  *
  * @param array a short array
  * @return A new Array of Short values
  */
 public static Array<Short> ofAll(short[] array) {
   Objects.requireNonNull(array, "array is null");
   return ofAll(Iterator.ofAll(array));
 }
Example #3
0
 /**
  * Creates a Array based on the elements of an int array.
  *
  * @param array an int array
  * @return A new Array of Integer values
  */
 public static Array<Integer> ofAll(int[] array) {
   Objects.requireNonNull(array, "array is null");
   return ofAll(Iterator.ofAll(array));
 }
Example #4
0
 /**
  * Creates a Array based on the elements of a long array.
  *
  * @param array a long array
  * @return A new Array of Long values
  */
 public static Array<Long> ofAll(long[] array) {
   Objects.requireNonNull(array, "array is null");
   return ofAll(Iterator.ofAll(array));
 }
Example #5
0
 /**
  * Creates a Array based on the elements of a double array.
  *
  * @param array a double array
  * @return A new Array of Double values
  */
 public static Array<Double> ofAll(double[] array) {
   Objects.requireNonNull(array, "array is null");
   return ofAll(Iterator.ofAll(array));
 }
Example #6
0
 /**
  * Creates a Array based on the elements of a char array.
  *
  * @param array a char array
  * @return A new Array of Character values
  */
 public static Array<Character> ofAll(char[] array) {
   Objects.requireNonNull(array, "array is null");
   return ofAll(Iterator.ofAll(array));
 }