The NavigableSet<E> Interface The NavigableSet<E> interface extends the SortedSet<E> interface with navigation methods to find the closest matches for given…
16.1 Introduction to Streams A stream allows aggregate operations to be performed on a sequence of elements. An aggregate operation…
16.2 Running Example: The CD Record Class We will use the CD record class and the Genre enum type from…
If the weight group is not in the map, its frequency is set to 1; otherwise, the method reference Integer::sum…
15.11 The Collections Class The Java Collections Framework also contains two utility classes, Collections and Arrays, that provide various operations…
15.7 Deques In this section we look at deques—that is, linear collections that allow processing of elements from both ends.…
Searching in Arrays A common operation on an array is to search the array for a given element, called the…
The TreeMap<K,V> Class The TreeMap<K, V> class is the analog of the TreeSet<E> class (p. 812), but in this case…
Creating Unmodifiable Maps Creating unmodifiable maps is analogous to creating unmodifiable lists (§12.2, p. 649) or unmodifiable sets (p. 804).…
15.6 Queues In this section we look at the different types of queues provided by the Java Collections Framework. The…