eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'AutoResizingOrderedCollection':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: AutoResizingOrderedCollection


Inheritance:

   Object
   |
   +--Collection
      |
      +--SequenceableCollection
         |
         +--OrderedCollection
            |
            +--AutoResizingOrderedCollection
               |
               +--AutoResizingOrderedCollectionWithDefault

Package:
stx:libbasic2
Category:
Collections-Sequenceable
Version:
rev: 1.8 date: 2017/02/15 21:15:43
user: cg
file: AutoResizingOrderedCollection.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


I am an ordered collection which automatically resizes if elements
are added beyond the size. 
I.e. if #at:put: is sent for indexes > the current size, the receiver grows to
the required index and missing fields are implicitly filled with nils.
Queries for non-existing elements are anwered with nil.


Related information:

    OrderedCollection
    Array
    SparseArray

Class protocol:

instance creation
o  newWithDefaultValue: defaultValue


Instance protocol:

accessing
o  at: index
fetch an object at index.
If index is beyond the actual size, return nil
(i.e. this is an alias for at:index ifAbsent:[nil])

o  at: index put: anObject
store an object at index.
If required, grow the receiver to ensure that index is valid


Examples:


|coll| coll := AutoResizingOrderedCollection new. coll at:4 put:'four'. coll at:8 put:'eight'. coll at:9

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sun, 27 Nov 2022 08:33:59 GMT