Home‎ > ‎Applied Core Java‎ > ‎

Collection Framework

Quick Link

ArrayList - A dynamic duplicate element list.
Vector - A dynamic duplicate element list. It is thread safe.
HashSet - A dynamic unique element set
TreeSet - A dynamic unique element sorted set.
HashMap - A dynamic index map.
Hashtable - A dynamic index map. It is thread safe.
Iterator - Access elements sequentially from a SET and LIST
Enumeration -
Access elements sequentially from a Vector and Hashtable
The Collection Framework is set of four key interfaces Set, List, Queue and Collection. It provides sorting and searching algorithms on the group of objects. It also contains Map interface that consists of Set and List objects.

Two interface trees, one starting with Collection and including Set, SortedSet, List, and Queue, and the other starting with Map and including SortedMap.

                   
Note that the hierarchy consists of two distinct trees — a Map is not a true Collection.

Key Classes and Interfaces

Interface

Set

List

Map

Implementation

HashSet

 

HashMap

 

ArrayList

 

TreeSet

 

Treemap

 

LinkedList

 

Historical

 

Vector

Stack

Hashtable

Properties


Definitions
  • Collection-A collection represents a group of objects known as its elements
  • Set - cannot contain duplicate elements.
    •  Ex SET [1,2,4,5,6,7,8]
  • List- ordered collection, can contain duplicate elements.
    • Ex LIST [1,2,4,5,7,3,3,4,5]
  • Queue - hold multiple elements prior to processing. a Queue provides additional insertion, extraction, and inspection operations.
    • Ex QUEUE [1,2,4,5,7,3,3,4,5]
  • Map - an object that maps keys to values. A Map cannot contain duplicate keys
    • Ex MAP [{1,”ONE”},{2,”TWO”},{3,”THREE”},{4,”THREE”}]
  • SortedSet — a Set that maintains its elements in ascending order.
  • SortedMap — a Map that maintains its mappings in ascending key order


<<Previous | Next>>