There are interfaces to separate the kinds of collections (List) to their implemantations (ArrayList, LinkedList, etc).
Main interfaces:
Collection
— the root of the
collection hierarchy. A collection represents a group of objects
known as its elements.
Set
— a collection that cannot
contain duplicate elements (no consept of order).
List
— an ordered collection
(sometimes called a sequence). Lists can contain duplicate
elements.
Queue
— a collection used to
hold multiple elements prior to processing.Queues typically, but do
not necessarily, order elements in a FIFO (first-in, first-out)
manner. Among the exceptions are priority queues.
Map
— an object that maps keys
to values. A Map cannot contain duplicate keys; each key can map to
at most one value.
Srted versions:
SortedSet
— a Set that
maintains its elements in ascending order. Sorted sets are used for
naturally ordered sets, such as word lists and membership
rolls.
SortedMap
— a Map that
maintains its mappings in ascending key order. Sorted maps are used
for naturally ordered collections of key/value pairs, such as
dictionaries and telephone directories
Copyright © 1998-2009 Dilvan Moreira