예제 #1
1
 /**
  * Returns a new Node containing the given value and having no children.
  *
  * @param value A value
  * @param <T> Value type
  * @return A new Node instance.
  */
 static <T> Node<T> of(T value) {
   return new Node<>(value, List.empty());
 }
예제 #2
1
 @Override
 public <U> Array<U> scanRight(U zero, BiFunction<? super T, ? super U, ? extends U> operation) {
   Objects.requireNonNull(operation, "operation is null");
   return Collections.scanRight(
       this, zero, operation, List.empty(), List::prepend, list -> Array.wrap(list.toJavaArray()));
 }
예제 #3
1
 @Override
 default <U> Seq<U> scanRight(U zero, BiFunction<? super T, ? super U, ? extends U> operation) {
   Objects.requireNonNull(operation, "operation is null");
   return Collections.scanRight(
       this, zero, operation, List.empty(), List::prepend, Function.identity());
 }
예제 #4
0
 @Override
 protected <T> List<T> empty() {
   return List.empty();
 }