Ejemplo n.º 1
0
 @Override
 default Tree<T> peek(Consumer<? super T> action) {
   Objects.requireNonNull(action, "action is null");
   if (!isEmpty()) {
     action.accept(head());
   }
   return this;
 }
Ejemplo n.º 2
0
 public void consumePosRange(int iposStart, int iposEnd, Consumer out) {
   if (out.ignoring()) return;
   int i = nextIndex(iposStart);
   int end = nextIndex(iposEnd);
   for (; i < end; i++) out.writeFloat(floatAt(i));
 }