mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +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
91bf1a29d4
commit
1cc97bb19f
1 changed files with 18 additions and 7 deletions
|
@ -23,14 +23,13 @@
|
||||||
|
|
||||||
#include <objects/stdobjects.h>
|
#include <objects/stdobjects.h>
|
||||||
#include <foundation/NSArray.h>
|
#include <foundation/NSArray.h>
|
||||||
|
#include <objects/Array.h>
|
||||||
|
|
||||||
|
@interface NSArray (libobjects) <IndexedCollecting>
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation NSArray
|
@implementation NSArray
|
||||||
|
|
||||||
+ (id) allocWithZone: (NSZone*)zone
|
|
||||||
{
|
|
||||||
return [self alloc]; /* for now, until we get zones. */
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (id) array
|
+ (id) array
|
||||||
{
|
{
|
||||||
return [[[self alloc] init] autorelease];
|
return [[[self alloc] init] autorelease];
|
||||||
|
@ -55,12 +54,18 @@
|
||||||
return [n autorelease];
|
return [n autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) initWithCapacity: (unsigned)cap
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (id) initWithArray: (NSArray*)array
|
- (id) initWithArray: (NSArray*)array
|
||||||
{
|
{
|
||||||
int i, c;
|
int i, c;
|
||||||
|
|
||||||
c = [array count];
|
c = [array count];
|
||||||
[super initWithCapacity:c];
|
[self initWithCapacity:c];
|
||||||
for (i = 0; i < c; i++)
|
for (i = 0; i < c; i++)
|
||||||
[self addObject:[array objectAtIndex:i]];
|
[self addObject:[array objectAtIndex:i]];
|
||||||
return self;
|
return self;
|
||||||
|
@ -109,7 +114,7 @@
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
- (id) lastObject; /* inherited */
|
- (id) lastObject; /* inherited */
|
||||||
- (id) objectAtIndex: (unsigned)index;
|
- (id) objectAtIndex: (unsigned)index; /* inherited */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
- (NSEnumerator*) objectEnumerator
|
- (NSEnumerator*) objectEnumerator
|
||||||
|
@ -191,4 +196,10 @@
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString*) description
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue