mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
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:
parent
a1d32c0e7e
commit
6434193cab
1 changed files with 18 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue