Figure 10-1 shows the
main interfaces of the Java Collections Framework, together with one other—
Iterable—which is outside the Framework but is an
essential adjunct to it. Its purpose is as follows:
Iterable defines the contract
that a class has to fulfill for its instances to be usable with the
And the Framework interfaces have the following purposes:
Collection contains the core
functionality required of any collection other than a map. It has no direct concrete implementations; the
concrete collection classes all implement one of its subinterfaces as
Set is a collection, without
duplicates, in which order is not significant.
SortedSet automatically sorts its elements and
returns them in order.
extends this, adding methods to find the closest matches to a target
Queue is a collection designed
to accept elements at its tail for processing,
yielding them up at its head in the order in which
they are to be processed. Its subinterface
Deque extends this by allowing elements to be
added or removed at both head and tail.
Deque have subinterfaces,
BlockingDeque respectively, that support
concurrent access and allow threads to be blocked, indefinitely or for a
maximum time, until the requested operation can be carried
List is a collection in which
order is significant, accommodating duplicate elements.
Map is a collection which uses key-value associations ...