Home | History | Annotate | Download | only in stream

Lines Matching defs:of

6  * under the terms of the GNU General Public License version 2 only, as
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * You should have received a copy of the GNU General Public License version
51 * A sequence of elements supporting sequential and parallel aggregate
63 * a stream of {@code Widget} objects via {@link Collection#stream Collection.stream()},
65 * transform it into a stream of {@code int} values representing the weight of
68 * <p>In addition to {@code Stream}, which is a stream of object references,
70 * and {@link DoubleStream}, all of which are referred to as "streams" and
75 * <em>stream pipeline</em>. A stream pipeline consists of a source (which
87 * management of, and access to, their elements. By contrast, streams do not
110 * of the stream pipeline).</li>
113 * <p>Such parameters are always instances of a
121 * the same source feeds two or more pipelines, or multiple traversals of the
136 * execution mode is a property of the stream. Streams are created
137 * with an initial choice of sequential or parallel execution. (For example,
140 * a parallel one.) This choice of execution mode may be modified by the
144 * @param <T> the type of the stream elements
154 * Returns a stream consisting of the elements of this stream that match
169 * Returns a stream consisting of the results of applying the given
170 * function to the elements of this stream.
175 * @param <R> The element type of the new stream
184 * Returns an {@code IntStream} consisting of the results of applying the
185 * given function to the elements of this stream.
198 * Returns a {@code LongStream} consisting of the results of applying the
199 * given function to the elements of this stream.
212 * Returns a {@code DoubleStream} consisting of the results of applying the
213 * given function to the elements of this stream.
226 * Returns a stream consisting of the results of replacing each element of
227 * this stream with the contents of a mapped stream produced by applying
237 * The {@code flatMap()} operation has the effect of applying a one-to-many
238 * transformation to the elements of the stream, and then flattening the
243 * <p>If {@code orders} is a stream of purchase orders, and each purchase
244 * order contains a collection of line items, then the following produces a
251 * stream of the {@code words} contained in that file:
254 * Stream<String> words = lines.flatMap(line -> Stream.of(line.split(" +")));
257 * using a simple regular expression, into an array of words, and then
258 * creates a stream of words from that array.
260 * @param <R> The element type of the new stream
264 * of new values
270 * Returns an {@code IntStream} consisting of the results of replacing each
271 * element of this stream with the contents of a mapped stream produced by
283 * of new values
290 * Returns an {@code LongStream} consisting of the results of replacing each
291 * element of this stream with the contents of a mapped stream produced by
303 * of new values
310 * Returns an {@code DoubleStream} consisting of the results of replacing
311 * each element of this stream with the contents of a mapped stream produced
323 * of new values
330 * Returns a stream consisting of the distinct elements (according to
331 * {@link Object#equals(Object)}) of this stream.
333 * <p>For ordered streams, the selection of distinct elements is stable
348 * pipelines, if the semantics of your situation permit. If consistency
359 * Returns a stream consisting of the elements of this stream, sorted
360 * according to natural order. If the elements of this stream are not
375 * Returns a stream consisting of the elements of this stream, sorted
392 * Returns a stream consisting of the elements of this stream, additionally
407 * Stream.of("one", "two", "three", "four")
423 * Returns a stream consisting of the elements of this stream, truncated
432 * especially for large values of {@code maxSize}, since {@code limit(n)}
437 * speedups of {@code limit()} in parallel pipelines, if the semantics of
443 * @param maxSize the number of elements the stream should be limited to
450 * Returns a stream consisting of the remaining elements of this stream
451 * after discarding the first {@code n} elements of the stream.
461 * especially for large values of {@code n}, since {@code skip(n)}
466 * speedups of {@code skip()} in parallel pipelines, if the semantics of
472 * @param n the number of leading elements to skip
479 * Performs an action for each element of this stream.
484 * <p>The behavior of this operation is explicitly nondeterministic.
486 * guarantee to respect the encounter order of the stream, as doing so
487 * would sacrifice the benefit of parallelism. For any given element, the
498 * Performs an action for each element of this stream, in the encounter
499 * order of the stream if the stream has a defined encounter order.
517 * Returns an array containing the elements of this stream.
522 * @return an array containing the elements of this stream
527 * Returns an array containing the elements of this stream, using the
536 * The generator function takes an integer, which is the size of the
537 * desired array, and produces an array of the desired size. This can be
545 * @param <A> the element type of the resulting array
546 * @param generator a function which produces a new array of the desired
549 * @throws ArrayStoreException if the runtime type of the array returned
550 * from the array generator is not a supertype of the runtime type of every
557 * elements of this stream, using the provided identity value and an
580 * cases of reduction. Summing a stream of numbers can be expressed as:
595 * synchronization and with greatly reduced risk of data races.
602 * @return the result of the reduction
608 * elements of this stream, using an
623 * return foundAny ? Optional.of(result) : Optional.empty();
638 * @return an {@link Optional} describing the result of the reduction
639 * @throws NullPointerException if the result of the reduction is null
648 * elements of this stream, using the provided identity, accumulation and
672 * by an explicit combination of {@code map} and {@code reduce} operations.
678 * @param <U> The type of the result
689 * @return the result of the reduction
699 * reduction</a> operation on the elements of this stream. A mutable
702 * the state of the result rather than by replacing the result. This
725 * <p>The following will take a stream of strings and concatenates them into a
733 * @param <R> type of the result
746 * @return the result of the reduction
754 * reduction</a> operation on the elements of this stream using a
757 * {@link #collect(Supplier, BiConsumer, BiConsumer)}, allowing for reuse of
758 * collection strategies and composition of collect operations such as
772 * instantiated, populated, and merged so as to maintain isolation of
797 * @param <R> the type of the result
798 * @param <A> the intermediate accumulation type of the {@code Collector}
800 * @return the result of the reduction
807 * Returns the minimum element of this stream according to the provided
808 * {@code Comparator}. This is a special case of a
815 * {@code Comparator} to compare elements of this stream
816 * @return an {@code Optional} describing the minimum element of this stream,
823 * Returns the maximum element of this stream according to the provided
824 * {@code Comparator}. This is a special case of a
832 * {@code Comparator} to compare elements of this stream
833 * @return an {@code Optional} describing the maximum element of this stream,
840 * Returns the count of elements in this stream. This is a special case of
849 * @return the count of elements in this stream
854 * Returns whether any elements of this stream match the provided
863 * This method evaluates the <em>existential quantification</em> of the
864 * predicate over the elements of the stream (for some x P(x)).
868 * predicate to apply to elements of this stream
869 * @return {@code true} if any elements of the stream match the provided
875 * Returns whether all elements of this stream match the provided predicate.
884 * This method evaluates the <em>universal quantification</em> of the
885 * predicate over the elements of the stream (for all x P(x)). If the
887 * satisfied</em> and is always {@code true} (regardless of P(x)).
891 * predicate to apply to elements of this stream
892 * @return {@code true} if either all elements of the stream match the
898 * Returns whether no elements of this stream match the provided predicate.
907 * This method evaluates the <em>universal quantification</em> of the
908 * negated predicate over the elements of the stream (for all x ~P(x)). If
910 * and is always {@code true}, regardless of P(x).
914 * predicate to apply to elements of this stream
915 * @return {@code true} if either no elements of the stream match the
921 * Returns an {@link Optional} describing the first element of this stream,
928 * @return an {@code Optional} describing the first element of this stream,
935 * Returns an {@link Optional} describing some element of the stream, or an
941 * <p>The behavior of this operation is explicitly nondeterministic; it is
947 * @return an {@code Optional} describing some element of this stream, or an
959 * @param <T> type of elements
969 * @param <T> the type of stream elements
980 * @param <T> the type of stream elements
983 public static<T> Stream<T> of(T t) {
990 * @param <T> the type of stream elements
991 * @param values the elements of the new stream
996 public static<T> Stream<T> of(T... values) {
1002 * application of a function {@code f} to an initial element {@code seed},
1003 * producing a {@code Stream} consisting of {@code seed}, {@code f(seed)},
1008 * {@code n}, will be the result of applying the function {@code f} to the
1011 * @param <T> the type of stream elements
1041 * generating constant streams, streams of random elements, etc.
1043 * @param <T> the type of stream elements
1044 * @param s the {@code Supplier} of generated elements
1055 * elements of the first stream followed by all the elements of the
1057 * of the input streams are ordered, and parallel if either of the input
1063 * Accessing an element of a deeply concatenated stream can result in deep
1066 * @param <T> The type of stream elements
1069 * @return the concatenation of the two input streams
1083 * A mutable builder for a {@code Stream}. This allows the creation of a
1095 * @param <T> the type of stream elements