"A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data."
"A collections framework is a unified architecture for representing and manipulating collections. All collections frameworks contain the following:
- Interfaces: These are abstract data types that represent collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages, interfaces generally form a hierarchy.
- Implementations: These are the concrete implementations of the collection interfaces. In essence, they are reusable data structures.
- Algorithms: These are the methods that perform useful computations, such as searching and sorting, on objects that implement collection interfaces. The algorithms are said to be polymorphic: that is, the same method can be used on many different implementations of the appropriate collection interface. In essence, algorithms are reusable functionality."
Iterator
is an object that enables you to traverse through a collection and to remove elements from the collection selectively, if desired. You get an Iterator
for a collection by calling its iterator
method. The following is the Iterator
interface.public interface Iterator<E> { boolean hasNext(); E next(); void remove(); //optional }
"
My question is this: public interface Iterator<E>
"Public" is the access modifier.
"interface" is the declaration of the return data type.
"Iterator" is the name of the interface.
"<E>" is the argument passed to the Iterator interface.
WHAT IS E??? Is it a generic argument that allows for generalization
of the Iterator, or that anything may be passed to the Iterator method?
Or does <E> represent an index, or element of the Iterator collection???
Or both???
0 comments:
Post a Comment