functionalj.stream.StreamPlusHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functionalj-core Show documentation
Show all versions of functionalj-core Show documentation
The module for FunctionalJ Core.
package functionalj.stream;
import static functionalj.functions.ObjFuncs.notEqual;
import static functionalj.stream.ZipWithOption.AllowUnpaired;
import static java.lang.Boolean.TRUE;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import functionalj.function.Func2;
import lombok.val;
public class StreamPlusHelper {
static final Object dummy = new Object();
public static boolean hasAt(Stream stream, long index) {
return hasAt(stream, index, null);
}
public static boolean hasAt(Stream stream, long index, AtomicReference StreamPlusValue) {
// Note: It is done this way to avoid interpreting 'null' as no-value
val ref = new AtomicReference