List documentation

# List

List inherits from ArrayedCollection and defines instance variables first, last. It has subclasses IdentityList and OrderedCollection.

List (also known as OrderedCollection) is a flexible kind of array which allows insertions and removals at any index. It grows and shrinks as required to accomodate its elements.

## Methods defined in List:

### Methods for accessing:

- at: index
- at: index put: object
- size
  Possibly performance could be improved by keeping an extra size variable.

### Methods for adding/removing:

- add: object
- add: object after: anotherObject
- add: object afterIndex: index
- add: object before: anotherObject
- add: object beforeIndex: index
- addFirst: object
- addLast: object
- remove: object ifAbsent: exceptionBlock
- removeAtIndex: index
- removeFirst
- removeLast

### Methods for converting:

- asList

### Methods for enumerating:

- collect: block
  Copied from Collection>>#collect:
- do: block
- select: block

### Methods for initialization:

- initialize

### Methods for private:

- expandAtBeginning
- expandAtBeginningBy: amount
- expandAtEnd
- expandAtEndBy: amount
- expansionAmount
- primExpand: amount
  Expand at end by amount---answers a new copy.
- reallyExpandAtEndBy: amount
- slideToBeginning

Pocket Smalltalk Documentation