Java Generics and Collections, 2nd Edition (Second Early Release)

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Java Generics and Collections has been the go-to guide to generics for more than a decade. This second edition covers Java 21, providing a clear guide to generics from their most common uses to the strangest corner cases, giving you everything you need to know to use and write generic APIs effectively. It covers the collections library thoroughly, so you'll always know how and when to use each collection for any given task. And it explains stream processing, so you'll know which model to use and how they interoperate to get the best out of the platform library.

Author(s): Maurice Naftalin and Philip Wadler
Edition: 2
Publisher: O'Reilly Media, Inc.
Year: 2023

Language: English
Pages: 300

1. Subtyping and Wildcards
Subtyping and the Substitution Principle
Wildcards with extends
Wildcards with super
The Get and Put Principle
Arrays
Wildcards Versus Type Parameters
Wildcard Capture
Restrictions on Wildcards
2. Comparison and Bounds
Comparable
Maximum of a Collection
A Fruity Example
Comparator
Enumerated Types
Multiple Bounds
Bridges
Covariant Overriding
3. Declarations
Constructors
Static Members
Nested Classes
How Erasure Works
4. The Main Interfaces of the Java Collections Framework
Collection
Set
List
Queue
Map
Using the Different Collection Types
Sequenced Collections
SequencedCollection
SequencedSet and NavigableSet
Deque
SequencedMap and NavigableMap
5. Preliminaries
Iterable and Iterators
Implementations
Views
Performance
Memory
Instruction Count and the O-notation
Immutability and Unmodifiability
Contracts
Content-based Organization
Lambdas and Streams
Collections and Thread Safety
Synchronization and the Legacy Collections
Java 2: Synchronized Collections and Fail-Fast Iterators
Java 5: Concurrent Collections
6. The Collection Interface
Using the Methods of Collection
Implementing Collection
Collection Constructors
7. The SequencedCollection Interface
8. Sets
Set Implementations
HashSet
CopyOnWriteArraySet
EnumSet
UnmodifiableSet
SequencedSet
LinkedHashSet
NavigableSet
TreeSet
ConcurrentSkipListSet
Comparing Set Implementations
9. Queues
Using the Methods of Queue
Queue Implementations
PriorityQueue
ConcurrentLinkedQueue
BlockingQueue
Using the Methods of BlockingQueue
BlockingQueue Implementations
LinkedBlockingQueue
ArrayBlockingQueue
PriorityBlockingQueue
DelayQueue
SynchronousQueue
TransferQueue
Deques
Deque Implementations
ArrayDeque
LinkedList
BlockingDeque
Implementing BlockingDeque
Comparing Queue Implementations
10. Lists
Using the Methods of List
List Implementations
ArrayList
LinkedList
CopyOnWriteArrayList
Comparing List Implementations
11. Maps
Map.Entry
Using the Methods of Map
Map Implementations
HashMap
WeakHashMap
IdentityHashMap
EnumMap
UnmodifiableMap
SequencedMap
LinkedHashMap
NavigableMap
TreeMap
ConcurrentMap
ConcurrentHashMap
ConcurrentNavigableMap
ConcurrentSkipListMap
Comparing Map Implementations
12. The Collections Class
Generic Algorithms
Changing the Order of List Elements
Changing the Contents of a List
Finding Extreme Values in a Collection
Finding Specific Values in a List
Collection Factories
Wrappers
Synchronized Collections
Unmodifiable Collections
Checked Collections
Other Methods