Appendix C. Collections

This appendix introduces the Java Collections Framework.™ You will learn what collections are and how they'll make your job easier and your programs better. You'll learn about the core elements that comprise the Collections Framework: interfaces, implementations, and algorithms.

This appendix also describes the core collection interfaces, which are the heart and soul of the Java Collections Framework. You'll learn general guidelines for effective use of these interfaces, including when to use which interface. You'll also learn idioms for each interface to help you get the most out of the interfaces.

Collections

Introduction

What Is a Collections Framework?

Benefits

Drawbacks of the Collections Framework

Interfaces

Collection Interface

Set Interface

List Interface

Map Interface

Object Ordering

SortedSet Interface

SortedMap Interface

Implementations

General-Purpose Implementations

Wrapper Implementations

Convenience Implementations

Algorithms

Sorting

Shuffling

Routine Data Manipulation

Searching

Finding Extreme Values

Custom Implementations

Reasons to Write Your Own Implementation

How to Write a Custom Implementation

Interoperability

Compatibility

API Design

Категории