26.07.2013 Views

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 21 Collections 1233<br />

TreeMap implement the Map interface. HashMaps s<strong>to</strong>re elements in a HashTable, and<br />

TreeMaps s<strong>to</strong>re elements in a tree.<br />

• Interface SortedMap extends Map and maintains its elements in sorted order. Class TreeMap<br />

implements SortedMap.<br />

• The built-in collections are unsynchronized. Concurrent access <strong>to</strong> a Collection by independent<br />

threads could cause indeterminate results. To prevent this, synchronization wrappers are used<br />

around classes that might be accessed by multiple threads.<br />

• The Collections API provides a set of public static methods for converting collections<br />

<strong>to</strong> unmodifiable versions. Unmodifiable wrappers throw UnsupportedOperation-<br />

Exceptions if attempts are made <strong>to</strong> modify the collection.<br />

• The collections framework provides various abstract implementations (i.e., “bare bones” implementations<br />

of collection interfaces from which the programmer can quickly “flesh out” complete<br />

cus<strong>to</strong>mized implementations).<br />

TERMINOLOGY<br />

AbstractCollection class hasNext method<br />

AbstractList class implementation classes<br />

AbstractMap class insert an element in<strong>to</strong> a collection<br />

AbstractSequentialList class interface<br />

AbstractSet class isEmpty method<br />

add method itera<strong>to</strong>r<br />

addFirst method Itera<strong>to</strong>r interface<br />

addLast method key<br />

algorithms lexicographical comparison<br />

ArrayList LinkedList class<br />

arrays List interface<br />

arrays as collections ListItera<strong>to</strong>r<br />

Arrays.asList map<br />

bidirectional itera<strong>to</strong>r Map collection interface<br />

binarySearch algorithm mapping keys <strong>to</strong> values<br />

clear method mappings<br />

Collection interface maps as collections<br />

collections max algorithm<br />

Collections class min algorithm<br />

collections framework modifiable collections<br />

collections placed in arrays natural ordering<br />

Compara<strong>to</strong>r object next method<br />

copy algorithm one-<strong>to</strong>-one mapping<br />

data structures ordered collection<br />

delete an element from a collection ordering<br />

deque queue<br />

double-ended queue (deque) range-view methods<br />

duplicate elements reverse algorithm<br />

Enumeration interface reverseOrder method<br />

fill algorithm sequence<br />

HashMap class Set interface<br />

HashSet class shuffle algorithm<br />

Hashtable class size method<br />

hashtable implementation sort a List<br />

© Copyright 1992–2002 by Deitel & Associates, Inc. All Rights Reserved. 7/12/01

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!