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.9 date: 2021/01/20 14:07:12
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.

copyright

COPYRIGHT (c) 2015 by Claus Gittinger / eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Thu, 30 May 2024 09:44:52 GMT