This is BetterRealMutableArray.h in view mode; [Download] [Up]
/*-------------------------------------------------------------------------- * * You may freely copy, distribute, and reuse the code in this example. * SHL Systemhouse disclaims any warranty of any kind, expressed or * implied, as to its fitness for any particular use. * * * BetterRealMutableArray * * Inherits From: NSArray * * Conforms To: NSCopying, NSMutableCopying, NSCoding * * Declared In: RealMutableArray.h * * Class Description * * This array provides the standard computer science style array. * When an object is inserted at position n, it stays in position n * even if there are empty slots at lower indices. * * This subclass is created using the "Composite Object" scenario * described in NeXT's documentation on the Foundation Kit in the section * on Class Clusters. * * *------------------------------------------------------------------------*/ #import <foundation/foundation.h> @interface BetterRealMutableArray : NSMutableArray { id *array; int capacity; int count; } /*-------------------------------------------------------------------------- * Allocing, initing, and deallocing *------------------------------------------------------------------------*/ + arrayWithCapacity: (unsigned)aNumItems; - initWithCapacity:(unsigned)aNumItems; /*-------------------------------------------------------------------------- * Mutable array primitives *------------------------------------------------------------------------*/ - (void)addObject:object; - (void)replaceObjectAtIndex:(unsigned)index withObject:object; - (void)removeLastObject; - (void)insertObject:object atIndex:(unsigned)index; - (void)removeObjectAtIndex:(unsigned)index; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.