← 返回首页
BaseStream (Java SE 26 & JDK 26)
JavaScript is disabled on your browser.
Contents  
  1. Description
  2. Method Summary
  3. Method Details
    1. iterator()
    2. spliterator()
    3. isParallel()
    4. sequential()
    5. parallel()
    6. unordered()
    7. onClose(Runnable)
    8. close()
Hide sidebar  Show sidebar

Interface BaseStream<T, S extends BaseStream<T,S>>

Type Parameters: T - the type of the stream elements S - the type of the stream implementing BaseStream All Superinterfaces: AutoCloseable All Known Subinterfaces: DoubleStream, IntStream, LongStream, Stream<T>
public interface BaseStream<T, S extends BaseStream<T,S>> extends AutoCloseable
Base interface for streams, which are sequences of elements supporting sequential and parallel aggregate operations. The following example illustrates an aggregate operation using the stream types Stream and IntStream, computing the sum of the weights of the red widgets: int sum = widgets.stream() .filter(w -> w.getColor() == RED) .mapToInt(w -> w.getWeight()) .sum(); See the class documentation for Stream and the package documentation for java.util.stream for additional specification of streams, stream operations, stream pipelines, and parallelism, which governs the behavior of all stream types.
Since: 1.8 See Also:

Scripting on this page tracks web page traffic, but does not change the content in any way.