home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / Database / OTC_EOFBetaExamples_V1.0 / NSFoundation / ClassCluster / BetterRealMutableArray.h < prev    next >
Encoding:
Text File  |  1994-07-31  |  1.7 KB  |  57 lines

  1. /*--------------------------------------------------------------------------
  2.  *
  3.  *     You may freely copy, distribute, and reuse the code in this example.
  4.  *     SHL Systemhouse disclaims any warranty of any kind, expressed or  
  5.  *    implied, as to its fitness for any particular use.
  6.  *
  7.  *
  8.  *    BetterRealMutableArray
  9.  *
  10.  *    Inherits From:        NSArray
  11.  *
  12.  *    Conforms To:        NSCopying, NSMutableCopying, NSCoding
  13.  *
  14.  *    Declared In:        RealMutableArray.h
  15.  *
  16.  *    Class Description
  17.  *
  18.  *        This array provides the standard computer science style array.  
  19.  *        When an object is inserted at position n, it stays in position n
  20.  *        even if there are empty slots at lower indices.
  21.  *
  22.  *        This subclass is created using the "Composite Object" scenario 
  23.  *        described in NeXT's documentation on the Foundation Kit in the section
  24.  *        on Class Clusters.
  25.  *
  26.  *
  27.  *------------------------------------------------------------------------*/
  28. #import <foundation/foundation.h>
  29.  
  30.  
  31.  
  32.  
  33. @interface BetterRealMutableArray : NSMutableArray
  34. {
  35.     id        *array;
  36.     int        capacity;
  37.     int        count;
  38. }
  39.  
  40. /*--------------------------------------------------------------------------
  41.  *    Allocing, initing, and deallocing
  42.  *------------------------------------------------------------------------*/
  43. + arrayWithCapacity: (unsigned)aNumItems;
  44. - initWithCapacity:(unsigned)aNumItems;
  45.  
  46. /*--------------------------------------------------------------------------
  47.  *    Mutable array primitives
  48.  *------------------------------------------------------------------------*/
  49. - (void)addObject:object;
  50. - (void)replaceObjectAtIndex:(unsigned)index withObject:object;
  51. - (void)removeLastObject;
  52. - (void)insertObject:object atIndex:(unsigned)index;
  53. - (void)removeObjectAtIndex:(unsigned)index;
  54.  
  55.  
  56. @end
  57.