util.OptionalDouble: practical reference
util.OptionalDouble: practical reference: OptionalDouble is a value-based container for one primitive double or absence, without boxing to Double.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
util.OptionalDouble: practical reference: OptionalDouble is a value-based container for one primitive double or absence, without boxing to Double.
util.OptionalInt: practical reference: OptionalInt represents one present primitive int or absence and avoids creating an Integer object.
util.OptionalLong: practical reference: OptionalLong stores one present primitive long or an empty state without boxing to Long.
util.PriorityQueue: practical reference: PriorityQueue<E> is an unbounded heap queue whose head is the least element under natural ordering or the supplied Comparator.
The java.util.Queue interface describes a queue of elements awaiting processing. Learn how offer differs from add and poll differs from remove, how peek inspects the head, and how isEmpty checks whether the queue contains elements.
util.Random: practical reference: Random generates a pseudorandom sequence with a 48-bit linear algorithm; the same seed and identical call sequence produce the same values.
java.util.regex.Matcher applies a regular expression to text. matches() checks the entire region, find() searches for successive substrings, and group() reads the result of a successful match.
java.util.regex.Pattern stores a compiled regular expression. Pattern.compile creates the pattern, and Pattern.matcher creates a Matcher for checking an entire input or searching for matching subsequences.
util.regex.PatternSyntaxException: practical reference: PatternSyntaxException is an unchecked IllegalArgumentException that reports a syntax error while a regular-expression pattern is compiled.
java.util.Scanner reads text tokens and lines. Distinguish reading a number from reading the remainder of a line, and configure number formatting explicitly.
util.SequencedCollection: practical reference: SequencedCollection<E> defines a collection with a well-defined encounter order, operations at both ends, and a reverse-ordered view.
util.SequencedMap: practical reference: SequencedMap<K,V> is a map with a defined encounter order for mappings, operations on its first and last entries, and a reverse-ordered view.
util.SequencedSet: practical reference: SequencedSet<E> combines Set uniqueness with a defined encounter order, end operations, and a reversed view whose type remains SequencedSet.
util.ServiceLoader: practical reference: ServiceLoader<S> locates zero, one, or many service providers in the runtime environment and loads them lazily without exposing implementation locations.
Set<E> describes a collection of unique elements. Learn how to add, check, remove, and count elements, and distinguish the Set interface from the HashSet implementation.
SortedMap orders keys by their natural ordering or a comparator. firstKey() and lastKey() return the endpoint keys in that ordering; both throw an exception for an empty map.
java.util.Spliterator supports reading elements and partitioning the remaining range. Source characteristics describe properties such as ordering and size accuracy; splitting alone does not start parallel execution.
Collector<T, A, R> describes accumulating stream elements into mutable state and transforming it into a result. Learn the collector functions, parallel-processing requirements, and the meaning of its characteristics in Java SE 21.
The java.util.stream.Collectors class supplies collectors for Stream.collect. Combine Collectors.groupingByConcurrent with Collectors.summarizingDouble to calculate numeric summary statistics separately for each group.
DoubleStream processes primitive double values through a lazy pipeline. Learn stream creation, filtering, and the terminal operations count() and average().
IntStream processes primitive int values. It supports filtering data, testing conditions, and calculating element counts, sums, and averages.
LongStream processes primitive long values rather than Long objects. LongStream.of creates a stream from supplied values, and LongStream.sum completes processing and returns their sum as a long.
Stream<T> processes object references through a lazy pipeline. Learn stream creation, result arrays, primitive mappings, and encounter-order guarantees.
util.StringJoiner: practical reference: StringJoiner builds text from elements separated by a delimiter and optional prefix and suffix.