Spec-Zone .ru
спецификации, руководства, описания, API
|
public class StreamSupport extends Object
This class is mostly for library writers presenting stream views of their data structures; most static stream methods for end users are in <code>Streams</code>.
Unless otherwise stated, streams are created as sequential
streams. A sequential stream can be transformed into a parallel stream by
calling the parallel()
method on the created stream.
Constructor and Description |
---|
StreamSupport() |
Modifier and Type | Method and Description |
---|---|
static DoubleStream |
doubleParallelStream(Spliterator.OfDouble spliterator)
Creates a new parallel
DoubleStream from a
Spliterator.OfDouble . |
static DoubleStream |
doubleParallelStream(Supplier<? extends Spliterator.OfDouble> supplier,
int characteristics)
Creates a new parallel
DoubleStream from a Supplier of
Spliterator.OfDouble . |
static DoubleStream |
doubleStream(Spliterator.OfDouble spliterator)
Creates a new sequential
DoubleStream from a
Spliterator.OfDouble . |
static DoubleStream |
doubleStream(Supplier<? extends Spliterator.OfDouble> supplier,
int characteristics)
Creates a new sequential
DoubleStream from a Supplier of
Spliterator.OfDouble . |
static IntStream |
intParallelStream(Spliterator.OfInt spliterator)
Creates a new parallel
IntStream from a Spliterator.OfInt . |
static IntStream |
intParallelStream(Supplier<? extends Spliterator.OfInt> supplier,
int characteristics)
Creates a new parallel
IntStream from a Supplier of
Spliterator.OfInt . |
static IntStream |
intStream(Spliterator.OfInt spliterator)
Creates a new sequential
IntStream from a Spliterator.OfInt . |
static IntStream |
intStream(Supplier<? extends Spliterator.OfInt> supplier,
int characteristics)
Creates a new sequential
IntStream from a Supplier of
Spliterator.OfInt . |
static LongStream |
longParallelStream(Spliterator.OfLong spliterator)
Creates a new parallel
LongStream from a Spliterator.OfLong . |
static LongStream |
longParallelStream(Supplier<? extends Spliterator.OfLong> supplier,
int characteristics)
Creates a new parallel
LongStream from a Supplier of
Spliterator.OfLong . |
static LongStream |
longStream(Spliterator.OfLong spliterator)
Creates a new sequential
LongStream from a Spliterator.OfLong . |
static LongStream |
longStream(Supplier<? extends Spliterator.OfLong> supplier,
int characteristics)
Creates a new sequential
LongStream from a Supplier of
Spliterator.OfLong . |
static <T> Stream<T> |
parallelStream(Spliterator<T> spliterator)
Creates a new parallel
Stream from a Spliterator . |
static <T> Stream<T> |
parallelStream(Supplier<? extends Spliterator<T>> supplier,
int characteristics)
Creates a new parallel
Stream from a Supplier of
Spliterator . |
static <T> Stream<T> |
stream(Spliterator<T> spliterator)
Creates a new sequential
Stream from a Spliterator . |
static <T> Stream<T> |
stream(Supplier<? extends Spliterator<T>> supplier,
int characteristics)
Creates a new sequential
Stream from a Supplier of
Spliterator . |
public static <T> Stream<T> stream(Spliterator<T> spliterator)
Stream
from a Spliterator
.
The spliterator is only traversed, split, or queried for estimated size after the terminal operation of the stream pipeline commences.
It is strongly recommended the spliterator report a characteristic of
IMMUTABLE
or CONCURRENT
, or be
late-binding. Otherwise,
stream(Supplier, int)
should be used to
reduce the scope of potential interference with the source. See
Non-Interference for
more details.
T
- the type of stream elementsspliterator
- a Spliterator
describing the stream elementsStream
public static <T> Stream<T> parallelStream(Spliterator<T> spliterator)
Stream
from a Spliterator
.
The spliterator is only traversed, split, or queried for estimated size after the terminal operation of the stream pipeline commences.
It is strongly recommended the spliterator report a characteristic of
IMMUTABLE
or CONCURRENT
, or be
late-binding. Otherwise,
stream(Supplier, int)
should be used to
reduce the scope of potential interference with the source. See
Non-Interference for
more details.
T
- the type of stream elementsspliterator
- a Spliterator
describing the stream elementsStream
public static <T> Stream<T> stream(Supplier<? extends Spliterator<T>> supplier, int characteristics)
Stream
from a Supplier
of
Spliterator
.
The Supplier.get()
method will be invoked on the supplier no
more than once, and after the terminal operation of the stream pipeline
commences.
For spliterators that report a characteristic of IMMUTABLE
or CONCURRENT
, or that are
late-binding, it is likely
more efficient to use stream(java.util.Spliterator)
instead.
The use of a Supplier
in this form provides a level of
indirection that reduces the scope of potential interference with the
source. Since the supplier is only invoked after the terminal operation
commences, any modifications to the source up to the start of the
terminal operation are reflected in the stream result. See
Non-Interference for
more details.
T
- the type of stream elementssupplier
- a Supplier
of a Spliterator
characteristics
- Spliterator characteristics of the supplied
Spliterator
. The characteristics must be equal to
source.get().getCharacteristics()
.Stream
stream(Spliterator)
public static <T> Stream<T> parallelStream(Supplier<? extends Spliterator<T>> supplier, int characteristics)
Stream
from a Supplier
of
Spliterator
.
The Supplier.get()
method will be invoked on the supplier no
more than once, and after the terminal operation of the stream pipeline
commences.
For spliterators that report a characteristic of IMMUTABLE
or CONCURRENT
, or that are
late-binding, it is likely
more efficient to use stream(Spliterator)
instead.
The use of a Supplier
in this form provides a level of
indirection that reduces the scope of potential interference with the
source. Since the supplier is only invoked after the terminal operation
commences, any modifications to the source up to the start of the
terminal operation are reflected in the stream result. See
Non-Interference for
more details.
T
- the type of stream elementssupplier
- a Supplier
of a Spliterator
characteristics
- Spliterator characteristics of the supplied
Spliterator
. The characteristics must be equal to
source.get().getCharacteristics()
Stream
parallelStream(Spliterator)
public static IntStream intStream(Spliterator.OfInt spliterator)
IntStream
from a Spliterator.OfInt
.
The spliterator is only traversed, split, or queried for estimated size after the terminal operation of the stream pipeline commences.
It is strongly recommended the spliterator report a characteristic of
IMMUTABLE
or CONCURRENT
, or be
late-binding. Otherwise,
stream(Supplier, int)
} should be used to
reduce the scope of potential interference with the source. See
Non-Interference for
more details.
spliterator
- a Spliterator.OfInt
describing the stream elementsIntStream
public static IntStream intParallelStream(Spliterator.OfInt spliterator)
IntStream
from a Spliterator.OfInt
.
he spliterator is only traversed, split, or queried for estimated size after the terminal operation of the stream pipeline commences.
It is strongly recommended the spliterator report a characteristic of
IMMUTABLE
or CONCURRENT
, or be
late-binding. Otherwise,
stream(Supplier, int)
} should be used to
reduce the scope of potential interference with the source. See
Non-Interference for
more details.
spliterator
- a Spliterator.OfInt
describing the stream elementsIntStream
public static IntStream intStream(Supplier<? extends Spliterator.OfInt> supplier, int characteristics)
IntStream
from a Supplier
of
Spliterator.OfInt
.
The Supplier.get()
method will be invoked on the supplier no
more than once, and after the terminal operation of the stream pipeline
commences.
For spliterators that report a characteristic of IMMUTABLE
or CONCURRENT
, or that are
late-binding, it is likely
more efficient to use intStream(Spliterator.OfInt)
instead.
The use of a Supplier
in this form provides a level of
indirection that reduces the scope of potential interference with the
source. Since the supplier is only invoked after the terminal operation
commences, any modifications to the source up to the start of the
terminal operation are reflected in the stream result. See
Non-Interference for
more details.
supplier
- a Supplier
of a Spliterator.OfInt
characteristics
- Spliterator characteristics of the supplied
Spliterator.OfInt
. The characteristics must be equal to
source.get().getCharacteristics()
IntStream
intStream(Spliterator.OfInt)
public static IntStream intParallelStream(Supplier<? extends Spliterator.OfInt> supplier, int characteristics)
IntStream
from a Supplier
of
Spliterator.OfInt
.
The Supplier.get()
method will be invoked on the supplier no
more than once, and after the terminal operation of the stream pipeline
commences.
For spliterators that report a characteristic of IMMUTABLE
or CONCURRENT
, or that are
late-binding, it is likely
more efficient to use intStream(Spliterator.OfInt)
instead.
The use of a Supplier
in this form provides a level of
indirection that reduces the scope of potential interference with the
source. Since the supplier is only invoked after the terminal operation
commences, any modifications to the source up to the start of the
terminal operation are reflected in the stream result. See
Non-Interference for
more details.
supplier
- a Supplier
of a Spliterator.OfInt
characteristics
- Spliterator characteristics of the supplied
Spliterator.OfInt
. The characteristics must be equal to
source.get().getCharacteristics()
IntStream
intParallelStream(Spliterator.OfInt)
public static LongStream longStream(Spliterator.OfLong spliterator)
LongStream
from a Spliterator.OfLong
.
The spliterator is only traversed, split, or queried for estimated size after the terminal operation of the stream pipeline commences.
It is strongly recommended the spliterator report a characteristic of
IMMUTABLE
or CONCURRENT
, or be
late-binding. Otherwise,
stream(Supplier, int)
should be used to
reduce the scope of potential interference with the source. See
Non-Interference for
more details.
spliterator
- a Spliterator.OfLong
describing the stream
elementsLongStream
public static LongStream longParallelStream(Spliterator.OfLong spliterator)
LongStream
from a Spliterator.OfLong
.
The spliterator is only traversed, split, or queried for estimated size after the terminal operation of the stream pipeline commences.
It is strongly recommended the spliterator report a characteristic of
IMMUTABLE
or CONCURRENT
, or be
late-binding. Otherwise,
stream(Supplier, int)
should be used to
reduce the scope of potential interference with the source. See
Non-Interference for
more details.
spliterator
- a Spliterator.OfLong
describing the stream elementsLongStream
public static LongStream longStream(Supplier<? extends Spliterator.OfLong> supplier, int characteristics)
LongStream
from a Supplier
of
Spliterator.OfLong
.
The Supplier.get()
method will be invoked on the supplier no
more than once, and after the terminal operation of the stream pipeline
commences.
For spliterators that report a characteristic of IMMUTABLE
or CONCURRENT
, or that are
late-binding, it is likely
more efficient to use longStream(Spliterator.OfLong)
instead.
The use of a Supplier
in this form provides a level of
indirection that reduces the scope of potential interference with the
source. Since the supplier is only invoked after the terminal operation
commences, any modifications to the source up to the start of the
terminal operation are reflected in the stream result. See
Non-Interference for
more details.
supplier
- a Supplier
of a Spliterator.OfLong
characteristics
- Spliterator characteristics of the supplied
Spliterator.OfLong
. The characteristics must be equal to
source.get().getCharacteristics()
LongStream
longStream(Spliterator.OfLong)
public static LongStream longParallelStream(Supplier<? extends Spliterator.OfLong> supplier, int characteristics)
LongStream
from a Supplier
of
Spliterator.OfLong
.
The Supplier.get()
method will be invoked on the supplier no
more than once, and after the terminal operation of the stream pipeline
commences.
For spliterators that report a characteristic of IMMUTABLE
or CONCURRENT
, or that are
late-binding, it is likely
more efficient to use longStream(Spliterator.OfLong)
instead.
The use of a Supplier
in this form provides a level of
indirection that reduces the scope of potential interference with the
source. Since the supplier is only invoked after the terminal operation
commences, any modifications to the source up to the start of the
terminal operation are reflected in the stream result. See
Non-Interference for
more details.
supplier
- A Supplier
of a Spliterator.OfLong
characteristics
- Spliterator characteristics of the supplied
Spliterator.OfLong
. The characteristics must be equal to
source.get().getCharacteristics()
LongStream
longParallelStream(Spliterator.OfLong)
public static DoubleStream doubleStream(Spliterator.OfDouble spliterator)
DoubleStream
from a
Spliterator.OfDouble
.
The spliterator is only traversed, split, or queried for estimated size after the terminal operation of the stream pipeline commences.
It is strongly recommended the spliterator report a characteristic of
IMMUTABLE
or CONCURRENT
, or be
late-binding. Otherwise,
stream(Supplier, int)
should be used to
reduce the scope of potential interference with the source. See
Non-Interference for
more details.
spliterator
- A Spliterator.OfDouble
describing the stream elementsDoubleStream
public static DoubleStream doubleParallelStream(Spliterator.OfDouble spliterator)
DoubleStream
from a
Spliterator.OfDouble
.
The spliterator is only traversed, split, or queried for estimated size after the terminal operation of the stream pipeline commences.
It is strongly recommended the spliterator report a characteristic of
IMMUTABLE
or CONCURRENT
, or be
late-binding. Otherwise,
stream(Supplier, int)
should be used to
reduce the scope of potential interference with the source. See
Non-Interference for
more details.
spliterator
- A Spliterator.OfDouble
describing the stream elementsDoubleStream
public static DoubleStream doubleStream(Supplier<? extends Spliterator.OfDouble> supplier, int characteristics)
DoubleStream
from a Supplier
of
Spliterator.OfDouble
.
The Supplier.get()
method will be invoked on the supplier no
more than once, and after the terminal operation of the stream pipeline
commences.
For spliterators that report a characteristic of IMMUTABLE
or CONCURRENT
, or that are
late-binding, it is likely
more efficient to use doubleStream(Spliterator.OfDouble)
instead.
The use of a Supplier
in this form provides a level of
indirection that reduces the scope of potential interference with the
source. Since the supplier is only invoked after the terminal operation
commences, any modifications to the source up to the start of the
terminal operation are reflected in the stream result. See
Non-Interference for
more details.
supplier
- A Supplier
of a Spliterator.OfDouble
characteristics
- Spliterator characteristics of the supplied
Spliterator.OfDouble
. The characteristics must be equal to
source.get().getCharacteristics()
DoubleStream
doubleStream(Spliterator.OfDouble)
public static DoubleStream doubleParallelStream(Supplier<? extends Spliterator.OfDouble> supplier, int characteristics)
DoubleStream
from a Supplier
of
Spliterator.OfDouble
.
The Supplier.get()
method will be invoked on the supplier no
more than once, and after the terminal operation of the stream pipeline
commences.
For spliterators that report a characteristic of IMMUTABLE
or CONCURRENT
, or that are
late-binding, it is likely
more efficient to use doubleStream(Spliterator.OfDouble)
instead.
The use of a Supplier
in this form provides a level of
indirection that reduces the scope of potential interference with the
source. Since the supplier is only invoked after the terminal operation
commences, any modifications to the source up to the start of the
terminal operation are reflected in the stream result. See
Non-Interference for
more details.
supplier
- a Supplier
of a Spliterator.OfDouble
characteristics
- Spliterator characteristics of the supplied
Spliterator.OfDouble
. The characteristics must be equal to
source.get().getCharacteristics()
DoubleStream
doubleParallelStream(Spliterator.OfDouble)
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.
DRAFT ea-b92