Abstract data type
Abstract data types or ADTs are data types described in terms of the operations they support—their interface—rather than how they are implemented.
For example, a sequence (or list) could be defined as follows. A sequence contains a variable number of ordered elements, and supports the following operations:
- create a new, empty sequence
- get a handle to the first element of a sequence
- get a handle to the next element of a sequence
- get a handle to the last element of a sequence
- get a handle to the previous element of a sequence
- get a handle to an arbitrary element of a sequence
- insert an element at the beginning of a sequence
- insert an element at the end of a sequence
- insert an element after an element of a specific handle
- delete the first element of a sequence
- delete the last element of a sequence
- delete the element at a specific handle
- delete all elements between two handles
- get the value of the associated element of this handle
- modify the value of the associated element of this handle
Some programming languages, such as Ada and Modula-2, have explicit support for abstract data types. Object-oriented languages carry this a step further by adding inheritance and polymorphism to ADTs to get "objects".