All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.util.stream.Stream Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.

The newest version!
package java.util.stream;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Optional;
import java.util.function.*;

public interface Stream extends BaseStream> {
	Stream filter(Predicate predicate);

	 Stream map(Function mapper);

	IntStream mapToInt(ToIntFunction mapper);

	LongStream mapToLong(ToLongFunction mapper);

	DoubleStream mapToDouble(ToDoubleFunction mapper);

	 Stream flatMap(Function> mapper);

	IntStream flatMapToInt(Function mapper);

	LongStream flatMapToLong(Function mapper);

	DoubleStream flatMapToDouble(Function mapper);

	Stream distinct();

	Stream sorted();

	Stream sorted(Comparator comparator);

	Stream peek(Consumer action);

	Stream limit(long maxSize);

	Stream skip(long n);

	void forEach(Consumer action);

	void forEachOrdered(Consumer action);

	Object[] toArray();

	 A[] toArray(IntFunction generator);

	T reduce(T identity, BinaryOperator accumulator);

	Optional reduce(BinaryOperator accumulator);

	 U reduce(U identity, BiFunction accumulator, BinaryOperator combiner);

	 R collect(Supplier supplier, BiConsumer accumulator, BiConsumer combiner);

	 R collect(Collector collector);

	Optional min(Comparator comparator);

	Optional max(Comparator comparator);

	long count();

	boolean anyMatch(Predicate predicate);

	boolean allMatch(Predicate predicate);

	boolean noneMatch(Predicate predicate);

	Optional findFirst();

	Optional findAny();

	static  Builder builder() {
		throw new RuntimeException("Not implemented");
	}

	static  Stream empty() {
		throw new RuntimeException("Not implemented");
	}

	static  Stream of(T t) {
		throw new RuntimeException("Not implemented");
	}

	@SafeVarargs
	@SuppressWarnings("varargs") // Creating a stream from an array is safe
	static  Stream of(T... values) {
		throw new RuntimeException("Not implemented");
	}

	static  Stream iterate(final T seed, final UnaryOperator f) {
		throw new RuntimeException("Not implemented");
	}

	static  Stream generate(Supplier s) {
		throw new RuntimeException("Not implemented");
	}

	static  Stream concat(Stream a, Stream b) {
		throw new RuntimeException("Not implemented");
	}

	interface Builder extends Consumer {
		@Override
		void accept(T t);

		default Builder add(T t) {
			accept(t);
			return this;
		}

		Stream build();
	}
}