The beginnings for IndexedCollection coexistance.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@238 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1995-04-03 03:18:43 +00:00
parent a1d32c0e7e
commit 6434193cab

View file

@ -23,14 +23,13 @@
#include <objects/stdobjects.h>
#include <foundation/NSArray.h>
#include <objects/Array.h>
@interface NSArray (libobjects) <IndexedCollecting>
@end
@implementation NSArray
+ (id) allocWithZone: (NSZone*)zone
{
return [self alloc]; /* for now, until we get zones. */
}
+ (id) array
{
return [[[self alloc] init] autorelease];
@ -55,12 +54,18 @@
return [n autorelease];
}
- (id) initWithCapacity: (unsigned)cap
{
[self notImplemented:_cmd];
return self;
}
- (id) initWithArray: (NSArray*)array
{
int i, c;
c = [array count];
[super initWithCapacity:c];
[self initWithCapacity:c];
for (i = 0; i < c; i++)
[self addObject:[array objectAtIndex:i]];
return self;
@ -109,7 +114,7 @@
#if 0
- (id) lastObject; /* inherited */
- (id) objectAtIndex: (unsigned)index;
- (id) objectAtIndex: (unsigned)index; /* inherited */
#endif
- (NSEnumerator*) objectEnumerator
@ -191,4 +196,10 @@
return nil;
}
- (NSString*) description
{
[self notImplemented:_cmd];
return nil;
}
@end