Last updated at 4:32 pm UTC on 13 January 2022
OrderedCollection is a subclass of SequenceableCollection
An ordered collection is much like a generalised Smalltalk Arrays, with can grow and shrink as needed. The elements are kept in the order they are stored in and thus the ordered collection may also be seen and used as a stack.
a:= OrderedCollection new.
a.->an OrderedCollection(5 7)
a at:1 put:4.
a.->an OrderedCollection(4 7)
a.->an OrderedCollection(8 4 7 10)
a allButFirst do: [:elem | Transcript show: elem; cr].
Object withAllSubclasses class
select: [:cls | (cls methodDictionary keys
select: [:keySymbol | keySymbol asString beginsWith: 'pdicCode']) size > 0]
In Java the similar class to OrderedCollection is called "ArrayList".