{\rtf1\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fswiss Helvetica;\f2\fmodern Courier;}\paperw12000\paperh8000\margl40\margr40 \pard\f0\fs24\cf0 Portable Object Compiler (c) 1998,2003. All Rights Reserved.\fs16\ \ \ \ \ \ \ \f1\b\fs56\li2200 IdArray\f0\b0\fs16\ \ \ \ \ \ \f0\fs28\li2200 {\b {\f1 Inherits from:}} Array\fs16\ \ \fs16\ \ \f1\b\fs36\li1400 Class Description\b0\f0\fs16\ \ \f0\fs28\li2200 {\b IdArray} instances are used to hold objects ({\b nil} is allowed). This class is somewhat similar to {\b String}, the difference being that a String is an Array of bytes, while this class provides a somewhat similar API to {\i strings of id}.\fs16\ \ \f0\fs28\li2200 {\b {\f1 Note:}} This class is present mostly for compatibility with ICpak101. You most likely want to use {\b OrdCltn} instead of this class.\fs16\ \ \f0\fs28\li2200 The method {\f2 size} returns the number of non-nil objects in the {\b IdArray}. The method {\f2 capacity} returns the total number of objects that the array can hold.\fs16\ \ \fs16\ \ \f1\b\fs36\li1400 Method types\b0\f0\fs16\ \ \pard\tx2600\fs28\li2600\cf0 {\b Creation} \pard\tx6000\fs28\fi-3800\li6000\cf0 - new\ - new:\ - with:\ - copy\ - deepCopy\ - free\ \pard\fs16\ \ \pard\tx2600\fs28\li2600\cf0 {\b Interrogation} \pard\tx6000\fs28\fi-3800\li6000\cf0 - size\ - at:\ - at:put:\ \pard\fs16\ \ \pard\tx2600\fs28\li2600\cf0 {\b Resizing} \pard\tx6000\fs28\fi-3800\li6000\cf0 - capacity\ - capacity:\ - packContents\ \pard\fs16\ \ \pard\tx2600\fs28\li2600\cf0 {\b Printing} \pard\tx6000\fs28\fi-3800\li6000\cf0 - printOn:\ \pard\fs16\ \ \pard\tx2600\fs28\li2600\cf0 {\b Archiving} \pard\tx6000\fs28\fi-3800\li6000\cf0 - fileOutOn:\ - fileInFrom:\ \pard\fs16\ \ \fs16\ \ \f1\b\fs36\li1400 Methods\b0\f0\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 new\f0\b0\ \f0\fs28\li2500 +{\b new}\fs16\ \ \f0\fs28\li2200 Creates an instance whose value is set to the empty array.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 new:\f0\b0\ \f0\fs28\li2500 +{\b new}:(unsigned){\i n}\fs16\ \ \f0\fs28\li2200 Creates an instance of {\i n} {\b nil} objects.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 with:\f0\b0\ \f0\fs28\li2500 +{\b with}:(int){\i nArgs,...}\fs16\ \ \f0\fs28\li2200 Creates an instance of {\i nArgs} objects, using a variable number of arguments, that may contain {\b nil} objects.\fs16\ \ \f2\fs24\li2800 id myArray = [IdArray with:3,nil,[Object new],nil];\ \f0\fs16\ \fs16\ \ \f1\b\fs28\li2200 copy\f0\b0\ \f0\fs28\li2500 -{\b copy}\fs16\ \ \f0\fs28\li2200 Returns a copy of the receiver with its internal C array copied as well (but not the objects that it contains).\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 deepCopy\f0\b0\ \f0\fs28\li2500 -{\b deepCopy}\fs16\ \ \f0\fs28\li2200 Like {\f2 copy}, but also sends {\f2 deepCopy} messages to the objects in the IdArray.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 free\f0\b0\ \f0\fs28\li2500 -{\b free}\fs16\ \ \f0\fs28\li2200 Frees the receiver and its internal C array as well.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 size\f0\b0\ \f0\fs28\li2500 - (unsigned){\b size}\fs16\ \ \f0\fs28\li2200 Returns the number of non-nil objects in the array.\fs16\ \ \f0\fs28\li2200 {\b {\f1 Note:}} For Stepstone compatibility (with ICpak101) this method is, for this class, not the same as {\f2 capacity}. In the case of the {\b IntArray} class, {\f2 size} and {\f2 capacity} are the same.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 at:\f0\b0\ \f0\fs28\li2500 -{\b at}:(unsigned){\i anOffset}\fs16\ \ \f0\fs28\li2200 Returns the object at {\i anOffset} or signals the {\b OutOfBounds} exception if {\i anOffset} is greater than the length of the array.\fs16\ \ \f0\fs28\li2200 Unlike for {\b OrdCltn} instances, this method may return a nil object.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 at:put:\f0\b0\ \f0\fs28\li2500 -{\b at}:(unsigned){\i anOffset}{\b put}:{\i anObject}\fs16\ \ \f0\fs28\li2200 Replaces the object at {\i anOffset} with {\i anObject} and returns the old object which was in that location. Generates an out of bounds exception if {\i anOffset} is greater than the length of the array.\fs16\ \ \f0\fs28\li2200 Unlike for {\b OrdCltn} instances, this method will accept a nil object.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 capacity\f0\b0\ \f0\fs28\li2500 - (unsigned){\b capacity}\fs16\ \ \f0\fs28\li2200 Returns the total number of objects in the IdArray. (nil or non-nil).\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 capacity:\f0\b0\ \f0\fs28\li2500 -{\b capacity}:(unsigned){\i nSlots}\fs16\ \ \f0\fs28\li2200 Changes the capacity to {\i nSlots}. If {\i nSlots} is larger than the current capacity, the memory added at the end will be zero-filled. If {\i nSlots} is less than the current capacity, the array is truncated.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 packContents\f0\b0\ \f0\fs28\li2500 -{\b packContents}\fs16\ \ \f0\fs28\li2200 Removes nil objects while preserving the order of elements in the {\b IdArray}. Used to eliminate the 'hole' left by a {\f2 at:put:} message with a {\b nil} argument.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 printOn:\f0\b0\ \f0\fs28\li2500 -{\b printOn}:(IOD){\i aFile}\fs16\ \ \f0\fs28\li2200 Prints the array to {\i aFile} without appending a newline. Returns the receiver.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 fileOutOn:\f0\b0\ \f0\fs28\li2500 -{\b fileOutOn}:{\i aFiler}\fs16\ \ \f0\fs28\li2200 Writes the array on {\i aFiler}. Returns the receiver.\fs16\ \ \fs16\ \ \f1\b\fs28\li2200 fileInFrom:\f0\b0\ \f0\fs28\li2500 -{\b fileInFrom}:{\i aFiler}\fs16\ \ \f0\fs28\li2200 Reads a array object from {\i aFiler}. Returns the receiver.\fs16\ \ \fs16\ \ \ }