Java Collections
For Java developers of all levels,Java Collectionsprovides a truly indispensable guide to using the built-in collection classes, in an extremely clear and well-organized text. This title sets a high standard for a programming reference, one that will be appreciated by a wide range of readers.Although the Java collection classes are not nearly as complicated as the Standard Template Library classes in C++, it can still be a bit daunting to figure out what's included and what's not. Beginning with the simple "historical" Java collection classes (for arrays,Vector,Hashtable, andStack), the author shows you just how to do it, with clear reference to useful APIs for each collection type, plus short code snippets showing these APIs in action.The standout feature of this title is its clear presentation of the Java Collection Framework, the built-in set of classes in today's Java 2 standard. Other texts can get muddled with their coverage of these classes, but this one never loses the reader. Starting with the APIs that are available for every collection class, the book builds to show what's available in linked lists and map classes. The author does a great job at avoiding the confusion between different "implementations" of these basic container shapes. (Of course, he does explain the difference betweenHashMap,WeakHashMap, andTreeMap, for example, but not before showing which APIs are common to all map classes.)Beyond choosing and using the right collection class for the job, this text also excels at showing off the built-in algorithms that are available for manipulating collections (like for sorting and searching). Advanced sections give advice for defining your own custom collection classes should you need to go beyond the built-in classes. Final chapters look at third-party collection classes (like theJGLandutil.concurrentpackage) for doing even more.It's the clear focus on understanding and using today's Java collection classes effectively that helps make this title a winner. In all,Java Collectionsis a handy and truly worthwhile guide to using Java collections, something that all Java developers need to master to write effective software.--Richard DraganTopics covered:Guide to programming with Java collection classesThe "historical" Java collection classesArrays (declaring and creating arrays, copying and cloning, immutability, assignments and reflection, character arrays)TheVectorandStackclasses (basic operations and programming tips)The Enumeration interface (custom enumeration classes)TheDictionary,Hashtable, andBitSetclasses (APIs and programming hints)The Java Collections FrameworkTheCollectioninterface (built-in APIs for all collections)Using sets (includingHashSetandTreeSet)Listclasses (including bidirectional iteration)Maps (including map entries, theHashMap,WeakHashMap, andTreeMapclasses)Sorting with collections (designing withComparable,SortedSet, andSortedMap)Advanced features (prebuilt collections, searching and generic list operations)Array algorithm support (filling, sorting, and searching arrays)Hints for building custom collection classesForward and backward compatibility with Java collection classesChoosing the right collectionAlternative collection class libraries (JGL,util.concurrent, andColt, installation and programming hints)Quick reference to collection APIs