@Override public LazyContinuation<T> next() { return new LazyContinuation<T>(initial, toLazyFunction(initial, function)); } };
@Override public LazyContinuation<T> next() { return new LazyContinuation<T>(initial, toLazyFunction(initial, function)); } };
@Override public LazyContinuation<T> next() { if (!iterator.hasNext()) return null; return new LazyContinuation<T>(iterator.next(), this); } }
@Override public LazyContinuation<T> next() { if (!iterator.hasNext()) return null; return new LazyContinuation<T>(iterator.next(), this); } }
@Override public LazyContinuation<Integer> next() { if (delta < 0 && lower + delta < upper) return null; if (delta > 0 && lower + delta > upper) return null; return new LazyContinuation<Integer>(lower, new LazyRange(lower + delta, upper, delta)); }
@Override public LazyContinuation<Integer> next() { if (delta < 0 && lower + delta < upper) return null; if (delta > 0 && lower + delta > upper) return null; return new LazyContinuation<Integer>(lower, new LazyRange(lower + delta, upper, delta)); }
@Override public LazyContinuation<T> next() { if (valueIndex == 0) { for (Flow<T> flow : flows) { if (flow.isEmpty()) return null; } } return new LazyContinuation<T>(flows.get(valueIndex).first(), nextFunction()); }
@Override public LazyContinuation<T> next() { if (valueIndex == 0) { for (Flow<T> flow : flows) { if (flow.isEmpty()) return null; } } return new LazyContinuation<T>(flows.get(valueIndex).first(), nextFunction()); }
@Override public LazyContinuation<X> next() { if (flow.isEmpty()) return null; LazyValue<X> nextValue = new LazyMappedValue<T, X>(flow, mapper); return new LazyContinuation<X>(nextValue, new LazyMapper<T, X>(mapper, flow.rest())); }
@Override public LazyContinuation<X> next() { if (flow.isEmpty()) return null; LazyValue<X> nextValue = new LazyMappedValue<T, X>(flow, mapper); return new LazyContinuation<X>(nextValue, new LazyMapper<T, X>(mapper, flow.rest())); }
@Override public LazyContinuation<T> next() { if (flow.isEmpty()) return null; return new LazyContinuation<T>(new LazyFirst<T>(flow), new LazyWalk<T>(flow.rest())); } }
@Override public LazyContinuation<T> next() { if (flow.isEmpty() || length < 1) return null; return new LazyContinuation<T>(new LazyFirst<T>(flow), new LazyTake<T>(length - 1, flow.rest())); }
@Override public LazyContinuation<T> next() { if (flow.isEmpty()) return null; return new LazyContinuation<T>(new LazyFirst<T>(flow), new LazyWalk<T>(flow.rest())); } }
@Override public LazyContinuation<T> next() { if (flow.isEmpty() || length < 1) return null; return new LazyContinuation<T>(new LazyFirst<T>(flow), new LazyTake<T>(length - 1, flow.rest())); }
@Override public LazyContinuation<T> next() { if (left.isEmpty()) { if (right.isEmpty()) return null; return new LazyContinuation<T>(new LazyFirst<T>(right), new LazyWalk<T>(right.rest())); } return new LazyContinuation<T>(new LazyFirst<T>(left), new LazyConcat<T>(left.rest(), right)); }
@Override public LazyContinuation<T> next() { if (left.isEmpty()) { if (right.isEmpty()) return null; return new LazyContinuation<T>(new LazyFirst<T>(right), new LazyWalk<T>(right.rest())); } return new LazyContinuation<T>(new LazyFirst<T>(left), new LazyConcat<T>(left.rest(), right)); }
@Override public LazyContinuation<Tuple<A, B>> next() { if (aFlow.isEmpty() || bFlow.isEmpty()) return null; LazyZipValue<A, B> nextValue = new LazyZipValue<A, B>(aFlow, bFlow); return new LazyContinuation<Tuple<A, B>>(nextValue, new LazyZip<A, B>(aFlow.rest(), bFlow.rest())); } }
@Override public LazyContinuation<Tuple<A, B>> next() { if (aFlow.isEmpty() || bFlow.isEmpty()) return null; LazyZipValue<A, B> nextValue = new LazyZipValue<A, B>(aFlow, bFlow); return new LazyContinuation<Tuple<A, B>>(nextValue, new LazyZip<A, B>(aFlow.rest(), bFlow.rest())); } }
@Override public LazyContinuation<Y> next() { if (left.isEmpty() || right.isEmpty()) return null; LazyValue<Y> nextValue = new LazyMapped2Value<T, X, Y>(left, right, mapper); return new LazyContinuation<Y>(nextValue, new LazyMapper2<T, X, Y>(mapper, left.rest(), right.rest())); } }
@Override public LazyContinuation<Y> next() { if (left.isEmpty() || right.isEmpty()) return null; LazyValue<Y> nextValue = new LazyMapped2Value<T, X, Y>(left, right, mapper); return new LazyContinuation<Y>(nextValue, new LazyMapper2<T, X, Y>(mapper, left.rest(), right.rest())); } }