Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
OrderedCollection
Last updated at 8:34 am UTC on 30 April 2007
OrderedCollection is a subclass of Text

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 add:5.
a add:7.

a.->an OrderedCollection(5 7)
a size.->2

a at:1 put:4.
a.->an OrderedCollection(4 7)

a first.
a last.
a addFirst:8.
a addLast:10.
a.->an OrderedCollection(8 4 7 10)
a removeFirst.
a removeLast.

Subclass is:


In Java the similar class to OrderedCollection is called "ArrayList".