Stream.noneMatch: practical reference
Stream.noneMatch: practical reference: noneMatch is a short-circuiting terminal operation that returns true exactly when no stream element satisfies the supplied predicate.
CKTIS / Java
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Stream.noneMatch: practical reference: noneMatch is a short-circuiting terminal operation that returns true exactly when no stream element satisfies the supplied predicate.
Stream.peek: practical reference: Stream.peek(action) is a lazy intermediate operation that passes the same elements onward and invokes the Consumer as downstream traversal consumes them.
Stream.reduce: practical reference: Stream.reduce performs a terminal associative reduction: an identity overload returns the identity for an empty stream, while the overload without it returns Optional.empty().
Stream.skip: practical reference: Stream.skip(n) is a lazy stateful intermediate operation that discards the first n elements in encounter order and exposes the remainder.
Stream.sorted: practical reference: Stream.sorted is a stateful intermediate operation using natural order or a supplied Comparator; sorting is stable for an ordered stream.
Stream.takeWhile: practical reference: Stream.takeWhile(predicate) is a short-circuiting stateful intermediate operation; for an ordered stream it returns the longest matching prefix from the start.
Collect stream elements into an array of a chosen type, such as `String[]`, by supplying a function that creates an array of the requested length.
Stream.toList: practical reference: Stream.toList() is a terminal operation since Java 16 that accumulates elements in encounter order into an unmodifiable List.
StringBuilder.append(String) adds text to the end of an existing builder and returns that same object, allowing calls to be chained.
Distinguish buffer capacity from text length, chain append calls, and check that the buffer has grown without relying on a specific final capacity.
Size a mutable text buffer, save immutable results, and keep buffers separate across workers. Use explicit formatting to emit exactly two hexadecimal digits per byte.
StringBuilder.toString() returns a String containing the builder's current contents. Later builder changes do not change the returned text.
String.charAt(int index) returns the char at a zero-based index. It reads a UTF-16 code unit, not necessarily a complete Unicode character.
String.codePointAt returns an int representing a code point, but accepts a UTF-16 code-unit index, not a code-point ordinal.
String.codePointBefore returns the Unicode value before a UTF-16 code-unit index, accounting for surrogate pairs.
String.codePoints() returns an IntStream, combining UTF-16 surrogate pairs instead of processing each char unit separately.
String.compareTo compares strings lexicographically. The result's sign determines order; zero means equal contents.
Compare two strings lexicographically without distinguishing uppercase from lowercase, and read their order from the sign of the returned `int`.
In Java SE 21, `String.concat(String)` appends another string. If the argument is empty, it returns the original object.
String.contains checks whether text contains a given sequence of char values. It returns boolean, is case-sensitive, and does not interpret regular expressions.
Compare a String with a CharSequence or StringBuffer without converting the argument to String.
The `String(String)` constructor creates a distinct object with the same text. Use `==` to compare references and `equals` to compare string contents.
Choose an explicit charset to recover text from bytes and produce repeatable input for a hash. Learn which overloads replace invalid input and how to reject it instead.
String.equals compares string contents with case sensitivity. The == operator compares object identity rather than contents.