Java Reference
In-Depth Information
￿ There is a second element, third element, and so on.
￿ There is a last element.
￿ Given an element other than the last element, there is a ''next'' element.
￿ Given an element other than the first element, there is a ''previous''
element.
￿ An element can be removed from the collection.
￿ An element can be added to the collection.
￿
A specified element can be located in the collection by systematically
going through the collection.
In your programs, you may want to keep a collection of various elements, such as
addresses, students, employees, departments, and projects. This structure commonly
appears in various applications, and it is worth studying in its own right. We call this
organization a list, which is an example of an ADT.
There is a data type called Vector (discussed in Chapter 9) with basic operations such as:
￿ Insert an item.
￿ Delete an item.
￿ Find an item.
You can use a Vector object to create an address book. You would not need to
write a program to insert an address, delete an address, or find an item in your
address book. Java also allows you to create your own abstract data types through
classes.
An ADT is an abstraction of a commonly appearing data structure, along with a set of
defined operations on the data structure.
Abstract data type (ADT): A data type that specifies the logical properties without
concern for the implementation details.
Historically, the concept of ADT in computer programming developed as a way of
abstracting the common data structure and the associated operations. Along the way,
ADT provided information hiding. That is, ADT hides the implementation details of
the operations and the data from the users of the ADT. Users can use the operations of an
ADT without knowing how the operation is implemented.
Search WWH ::




Custom Search