Spec-Zone .ru
спецификации, руководства, описания, API
|
T
- The type of stream elementspublic interface CloseableStream<T> extends Stream<T>, AutoCloseable
CloseableStream
is a Stream
that can be closed.
The close method is invoked to release resources that the object is
holding (such as open files).Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this resource, relinquishing any underlying resources.
|
boolean |
isParallel()
Returns whether this stream, when executed, would execute in parallel
(assuming no further modification of the stream, such as appending
further intermediate operations or changing its parallelism).
|
Iterator<T> |
iterator()
Returns an iterator for the elements of this stream.
|
S |
parallel()
Returns an equivalent stream that is parallel.
|
S |
sequential()
Returns an equivalent stream that is sequential.
|
Spliterator<T> |
spliterator()
Returns a spliterator for the elements of this stream.
|
S |
unordered()
Returns an equivalent stream that is
unordered.
|
allMatch, anyMatch, builder, collect, collect, count, distinct, empty, filter, findAny, findFirst, flatMap, flatMapToDouble, flatMapToInt, flatMapToLong, forEach, forEachOrdered, generate, iterate, limit, map, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, of, of, peek, reduce, reduce, reduce, sorted, sorted, substream, substream, toArray, toArray
void close()
try
-with-resources statement. Does nothing if called when
the resource has already been closed.
This method does not allow throwing checked Exception
s like
AutoCloseable.close()
. Cases where the
close operation may fail require careful attention by implementers. It
is strongly advised to relinquish the underlying resources and to
internally mark the resource as closed. The close
method is unlikely to be invoked more than once and so this ensures
that the resources are released in a timely manner. Furthermore it
reduces problems that could arise when the resource wraps, or is
wrapped, by another resource.close
in interface AutoCloseable
AutoCloseable.close()
Iterator<T> iterator()
This is a terminal operation.
Spliterator<T> spliterator()
This is a terminal operation.
boolean isParallel()
true
if this stream would execute in parallel if executed
without further modification otherwise false
S sequential()
This is an intermediate operation.
S parallel()
This is an intermediate operation.
S unordered()
This is an intermediate operation.
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