Class next.util.MutableVector
CLASS DESCRIPTION
- Extends:
- next.util.ImmutableVector
The MutableVector class declares the programmatic interface to objects that manage a modifiable array of objects. This class adds insertion and deletion operations to the basic array-handling behavior inherited from ImmutableVector.
MutableVector methods are conceptually based on these primitive methods:
The other methods in its interface provide convenient ways of inserting an object into a specific slot in the array and removing an object based on its identity or position in the array.
A Note for Those Creating Subclasses of MutableVector
Although conceptually the MutableVector class has three primitive methods, two others also access the array's data directly. These methods are:
insertElementAt
removeElementAt
These methods could be implemented using the primitives listed above but doing so would incur unnecessary overhead. For instance, objects would receive retain and release messages as they were shifted to accommodate the insertion or deletion of an element.