# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# BaseStream

`public interface BaseStream`
`implements AutoCloseable`

java.util.stream.BaseStream<T, S extends java.util.stream.BaseStream<T, S>>

Known indirect subclasses DoubleStream, IntStream, LongStream, Stream<T>
DoubleStream | A sequence of primitive double-valued elements supporting sequential and parallel aggregate operations.
IntStream | A sequence of primitive int-valued elements supporting sequential and parallel aggregate operations.
LongStream | A sequence of primitive long-valued elements supporting sequential and parallel aggregate operations.
Stream<T> | A sequence of elements supporting sequential and parallel aggregate operations.

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.

See also:

- `Stream`
- `IntStream`
- `LongStream`
- `DoubleStream`
- java.util.stream

## Summary

### Public methods
`abstract void` | `close()` Closes this stream, causing all close handlers for this stream pipeline to be called.
`abstract boolean` | `isParallel()` Returns whether this stream, if a terminal operation were to be executed, would execute in parallel.
`abstract Iterator<T>` | `iterator()` Returns an iterator for the elements of this stream.
`abstract S` | `onClose(Runnable closeHandler)` Returns an equivalent stream with an additional close handler.
`abstract S` | `parallel()` Returns an equivalent stream that is parallel.
`abstract S` | `sequential()` Returns an equivalent stream that is sequential.
`abstract Spliterator<T>` | `spliterator()` Returns a spliterator for the elements of this stream.
`abstract S` | `unordered()` Returns an equivalent stream that is unordered.

### Inherited methods
From interface `java.lang.AutoCloseable`
`abstract void` | `close()` Closes this resource, relinquishing any underlying resources.

## Public methods

### close

    public abstract void close ()

Closes this stream, causing all close handlers for this stream pipeline to be called.

See also:

- `AutoCloseable.close()`

### isParallel

    public abstract boolean isParallel ()

Returns whether this stream, if a terminal operation were to be executed, would execute in parallel. Calling this method after invoking an terminal stream operation method may yield unpredictable results.

Returns
`boolean` | `true` if this stream would execute in parallel if executed

### iterator

    public abstract Iterator<T> iterator ()

Returns an iterator for the elements of this stream.

This is a terminal operation.

Returns
`Iterator<T>` | the element iterator for this stream

### onClose

    public abstract S onClose (Runnable closeHandler)

Returns an equivalent stream with an additional close handler. Close handlers are run when the `close()` method is called on the stream, and are executed in the order they were added. All close handlers are run, even if earlier close handlers throw exceptions. If any close handler throws an exception, the first exception thrown will be relayed to the caller of `close()`, with any remaining exceptions added to that exception as suppressed exceptions (unless one of the remaining exceptions is the same exception as the first exception, since an exception cannot suppress itself.) May return itself.

This is an intermediate operation.

Parameters
`closeHandler` | `Runnable`: A task to execute when the stream is closed

Returns
`S` | a stream with a handler that is run if the stream is closed

### parallel

    public abstract S parallel ()

Returns an equivalent stream that is parallel. May return itself, either because the stream was already parallel, or because the underlying stream state was modified to be parallel.

This is an intermediate operation.

Returns
`S` | a parallel stream

### sequential

    public abstract S sequential ()

Returns an equivalent stream that is sequential. May return itself, either because the stream was already sequential, or because the underlying stream state was modified to be sequential.

This is an intermediate operation.

Returns
`S` | a sequential stream

### spliterator

    public abstract Spliterator<T> spliterator ()

Returns a spliterator for the elements of this stream.

This is a terminal operation.

Returns
`Spliterator<T>` | the element spliterator for this stream

### unordered

    public abstract S unordered ()

Returns an equivalent stream that is unordered. May return itself, either because the stream was already unordered, or because the underlying stream state was modified to be unordered.

This is an intermediate operation.

Returns
`S` | an unordered stream

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*