Buying Options
Java Generics and Collections
Print $34.99
Add to Cart
Print+Ebook $38.49
Add to Cart
Ebook $27.99
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £26.99
Add to Cart
What is this?
Description
Java Generics and Collections covers everything from the most basic uses of generics to the strangest corner cases. It teaches you everything you need to know about the collections libraries, so you'll always know which collection is appropriate for any given task, and how to use it.
Full Description
Table of Contents
  1. Generics

    1. Chapter 1 Introduction

      1. Generics
      2. Boxing and Unboxing
      3. Foreach
      4. Generic Methods and Varargs
      5. Assertions
    2. Chapter 2 Subtyping and Wildcards

      1. Subtyping and the Substitution Principle
      2. Wildcards with extends
      3. Wildcards with super
      4. The Get and Put Principle
      5. Arrays
      6. Wildcards Versus Type Parameters
      7. Wildcard Capture
      8. Restrictions on Wildcards
    3. Chapter 3 Comparison and Bounds

      1. Comparable
      2. Maximum of a Collection
      3. A Fruity Example
      4. Comparator
      5. Enumerated Types
      6. Multiple Bounds
      7. Bridges
      8. Covariant Overriding
    4. Chapter 4 Declarations

      1. Constructors
      2. Static Members
      3. Nested Classes
      4. How Erasure Works
    5. Chapter 5 Evolution, Not Revolution

      1. Legacy Library with Legacy Client
      2. Generic Library with Generic Client
      3. Generic Library with Legacy Client
      4. Legacy Library with Generic Client
      5. Conclusions
    6. Chapter 6 Reification

      1. Reifiable Types
      2. Instance Tests and Casts
      3. Exception Handling
      4. Array Creation
      5. The Principle of Truth in Advertising
      6. The Principle of Indecent Exposure
      7. How to Define ArrayList
      8. Array Creation and Varargs
      9. Arrays as a Deprecated Type?
      10. Summing Up
    7. Chapter 7 Reflection

      1. Generics for Reflection
      2. Reflected Types are Reifiable Types
      3. Reflection for Primitive Types
      4. A Generic Reflection Library
      5. Reflection for Generics
      6. Reflecting Generic Types
    8. Chapter 8 Effective Generics

      1. Take Care when Calling Legacy Code
      2. Use Checked Collections to Enforce Security
      3. Specialize to Create Reifiable Types
      4. Maintain Binary Compatibility
    9. Chapter 9 Design Patterns

      1. Visitor
      2. Interpreter
      3. Function
      4. Strategy
      5. Subject-Observer
  2. Collections

    1. Chapter 10 The Main Interfaces of the Java Collections Framework

    2. Chapter 11 Preliminaries

      1. Iterable and Iterators
      2. Implementations
      3. Efficiency and the O-Notation
      4. Contracts
      5. Collections and Thread Safety
    3. Chapter 12 The Collection Interface

      1. Using the Methods of Collection
      2. Implementing Collection
      3. Collection Constructors
    4. Chapter 13 Sets

      1. Implementing Set
      2. SortedSet and NavigableSet
      3. Comparing Set Implementations
    5. Chapter 14 Queues

      1. Using the Methods of Queue
      2. Implementing Queue
      3. BlockingQueue
      4. Deque
      5. Comparing Queue Implementations
    6. Chapter 15 Lists

      1. Using the Methods of List
      2. Implementing List
      3. Comparing List Implementations
    7. Chapter 16 Maps

      1. Using the Methods of Map
      2. Implementing Map
      3. SortedMap and NavigableMap
      4. ConcurrentMap
      5. ConcurrentNavigableMap
      6. Comparing Map Implementations
    8. Chapter 17 The Collections Class

      1. Generic Algorithms
      2. Collection Factories
      3. Wrappers
      4. Other Methods
  1. Colophon

View Full Table of Contents
Product Details
Title:
Java Generics and Collections
By:
Maurice Naftalin, Philip Wadler
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
October 2006
Ebook Release:
February 2009
Pages:
288
Print ISBN:
978-0-596-52775-4
| ISBN 10:
0-596-52775-6
Ebook ISBN:
978-0-596-10265-4
| ISBN 10:
0-596-10265-8
Customer Reviews
About the Authors
  1. Maurice Naftalin

    Maurice Naftalin is Director of Software Development at Morningside Light Ltd., a software consultancy in the United Kingdom. Maurice consults mainly in object-oriented technologies and teaches Java classes part-time at Learning Tree. He has three decades' experience as a programmer, team leader, and commercial trainer.

    View Maurice Naftalin's full profile page.

  2. Philip Wadler

    Philip Wadler is a professor of theoretical computer science at the University of Edinburgh, Scotland, where his research focuses on functional and logic programming. He co-authored the Generic Java standard that became the basis for generics in Sun's Java 5.0 and also contributed to the XQuery language standard base. Professor Wadler received his Ph.D., in computer science from Carnegie-Mellon University and co-wrote "Introduction to Functional Programming" (Prentice-Hall).

    View Philip Wadler's full profile page.

Colophon

About the Authors Maurice Naftalin is Technical Director at Morningside Light Ltd., a software consultancy in the United Kingdom. He has most recently served as an architect and mentor at NSB Retail Systems plc, and as the leader of the client development team of a major U.K. government social service system. He has taught Java since 1998 at both basic and advanced levels for Learning Tree and Sun Educational Services.

Philip Wadler is professor of theoretical computer science at the University of Edinburgh, Scotland, where his research focuses on functional and logic programming. He co-authored the Generic Java standard that became the basis for generics in Sun's Java 5.0, and he also contributed to the XQuery language standard base. He received his Ph.D. in computer science from Carnegie-Mellon University and co-wrote Introduction to Functional Programming (Prentice-Hall).

Colophon The animal on the cover of Java Generics and Collections is an alligator. Alligators are found only in southern parts of the U.S. and in China. They are rare in China, native only to the Yangtze River Basin. Alligators generally cannot tolerate salt water and therefore live in freshwater ponds, swamps, and the like.

When first born, alligators are tiny, measuring only about six inches. However, it grow extremely fast in the first years of life-a foot each year. A fully grown female is usually around 9 feet and between 150 and 200 pounds, while an adult male typically reaches 11 feet and weighs about 350 to 400 pounds. The largest known alligator on record, found in Louisiana in the early 1900s, was 19 feet, 2 inches. A key identifying characteristic of an alligator's appearance is its short, broad snout. An adult alligator's skin is a gray-black color, which turns dark black when wet, and it has a white underbelly. Young alligators have yellow and white stripes across their backs. The shape of the snout and skin color provide physical characteristics that differentiate alligators from crocodiles, which have long, thin snouts and are a tan color.

Alligators are mainly nocturnal and do most of their hunting and feeding after the sun sets. They are carnivores and eat a large variety of food, such as turtles, fish, frogs, birds, snakes, small mammals, and even smaller alligators. However, once an alligator grows into adulthood, it really faces no threats-other than humans.

The cover image is a 19th-century engraving from the Dover Pictorial Archive. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed.

  • Book cover of Java Generics and Collections