Java Reference
In-Depth Information
chapter
6
the collections api
M any algorithms require the use of a proper representation of data to
achieve efficiency. This representation and the operations that are allowed for
it are known as a data structure . Each data structure allows arbitrary insertion
but differs in how it allows access to members in the group. Some data struc-
tures allow arbitrary access and deletions, whereas others impose restrictions,
such as allowing access to only the most recently or least recently inserted
item in the group.
As part of Java, a supporting library known as the Collections API is pro-
vided. Most of the Collections API resides in java.util . This API provides a
collection of data structures. It also provides some generic algorithms, such as
sorting. The Collections API makes heavy use of inheritance.
Our primary goal is to describe, in general terms, some examples and
applications of data structures. Our secondary goal is to describe the basics of
the Collections API, so that we can use it in Part Three. We do not discuss the
theory behind an efficient Collections API implementation until Part Four, at
which point we provide simplified implementations of some core Collections
API components. But delaying the discussion of the Collections API's imple-
mentation until after we use it is not a problem. We do not need to know how
something is implemented so long as we know that it is implemented.
 
Search WWH ::




Custom Search