mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Fixed indentation.
(arrayWithObject, arrayWithObjects, initWithArray, initWithObjects, initWithObjects:count:, indexOfObjectIdenticalTo:, firstObjectCommonWithArray, isEqualToArray, sortedArrayUsingFunction, sortedArrayUsingSelector): Implemented. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@265 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6bf584aa2b
commit
38961aced1
1 changed files with 186 additions and 341 deletions
527
Source/NSArray.m
527
Source/NSArray.m
|
@ -1,11 +1,11 @@
|
||||||
/* NSArray - Array object to hold other objects.
|
/* NSArray - Array object to hold other objects.
|
||||||
Copyright (C) 1993,1994 Free Software Foundation, Inc.
|
Copyright (C) 1993,1994 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Adam Fedor <fedor@boulder.colorado.edu>
|
Written by: Adam Fedor <fedor@boulder.colorado.edu>
|
||||||
Date: Mar 1995
|
Date: Mar 1995
|
||||||
|
|
||||||
This file is part of the GNU Objective C Class Library.
|
This file is part of the GNU Objective C Class Library.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
|
@ -15,11 +15,11 @@
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <foundation/NSArray.h>
|
#include <foundation/NSArray.h>
|
||||||
#include <foundation/NSString.h>
|
#include <foundation/NSString.h>
|
||||||
|
@ -28,282 +28,25 @@
|
||||||
|
|
||||||
+ allocWithZone:(NSZone *)zone
|
+ allocWithZone:(NSZone *)zone
|
||||||
{
|
{
|
||||||
return [[[NSArray alloc] init] autorelease];
|
return [[[NSArray alloc] init] autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ array
|
+ array
|
||||||
{
|
{
|
||||||
return [[[self alloc] init] autorelease];
|
return [[[self alloc] init] autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ arrayWithObject:anObject
|
+ arrayWithObject:anObject
|
||||||
{
|
{
|
||||||
[self notImplemented:_cmd];
|
return [[[[self alloc] init] addObject: anObject] autorelease];
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ arrayWithObjects:firstObj, ...
|
+ arrayWithObjects:firstObj, ...
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- initWithObjects:(id *)objects count:(unsigned)count
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- initWithObjects:firstObj, ...
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- initWithArray:(NSArray *)array
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (unsigned)count
|
|
||||||
{
|
|
||||||
return [super count];
|
|
||||||
}
|
|
||||||
|
|
||||||
- objectAtIndex:(unsigned)index
|
|
||||||
{
|
|
||||||
return [super objectAtIndex:index];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (unsigned)indexOfObjectIdenticalTo:anObject
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (unsigned)indexOfObject:anObject
|
|
||||||
{
|
|
||||||
return [super indexOfObject:anObject];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)containsObject:anObject
|
|
||||||
{
|
|
||||||
return [super includesObject:anObject];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)isEqualToArray:(NSArray *)otherArray;
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- lastObject
|
|
||||||
{
|
|
||||||
return [super lastObject];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)makeObjectsPerform:(SEL)aSelector
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)makeObjectsPerform:(SEL)aSelector withObject:argument
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (NSArray *)sortedArrayUsingSelector:(SEL)comparator
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *)sortedArrayUsingFunction:(int (*)(id, id, void *))comparator
|
|
||||||
context:(void *)context
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)componentsJoinedByString:(NSString *)separator
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- firstObjectCommonWithArray:(NSArray *)otherArray
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray *)subarrayWithRange:(NSRange)range
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- (NSEnumerator *)objectEnumerator
|
|
||||||
//{
|
|
||||||
// [self notImplemented:_cmd];
|
|
||||||
//}
|
|
||||||
|
|
||||||
//- (NSEnumerator *)reverseObjectEnumerator
|
|
||||||
//{
|
|
||||||
// [self notImplemented:_cmd];
|
|
||||||
// return 0;
|
|
||||||
//}
|
|
||||||
|
|
||||||
- (NSString *)description
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)descriptionWithIndent:(unsigned)level
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation NSMutableArray: NSArray
|
|
||||||
|
|
||||||
+ allocWithZone:(NSZone *)zone
|
|
||||||
{
|
|
||||||
return [[[NSMutableArray alloc] init] autorelease];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ arrayWithCapacity:(unsigned)numItems
|
|
||||||
{
|
|
||||||
return [[[self alloc] initWithCapacity:numItems] autorelease];
|
|
||||||
}
|
|
||||||
|
|
||||||
- initWithCapacity:(unsigned)numItems
|
|
||||||
{
|
|
||||||
return [super initWithCapacity:numItems];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)addObject:anObject
|
|
||||||
{
|
|
||||||
[super addObject:[anObject retain]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)replaceObjectAtIndex:(unsigned)index withObject:anObject
|
|
||||||
{
|
|
||||||
id old;
|
|
||||||
old = [super replaceObjectAtIndex:index with:[anObject retain]];
|
|
||||||
[old release];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)removeLastObject
|
|
||||||
{
|
|
||||||
[[super removeLastObject] release];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)insertObject:anObject atIndex:(unsigned)index
|
|
||||||
{
|
|
||||||
[super insertObject:[anObject retain] atIndex:index];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)removeObjectAtIndex:(unsigned)index
|
|
||||||
{
|
|
||||||
[[super removeObjectAtIndex:index] release];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)removeObjectIdenticalTo:anObject
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)removeObject:anObject
|
|
||||||
{
|
|
||||||
[[super removeObjectAtIndex:[super indexOfObject:anObject]] release];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)removeAllObjects
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)addObjectsFromArray:(NSArray *)otherArray
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)removeObjectsFromIndices:(unsigned *)indices numIndices:(unsigned)count
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)removeObjectsInArray:(NSArray *)otherArray
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)sortUsingFunction:(int (*)(id, id, void *))compare
|
|
||||||
context:(void *)context
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
/* Implementation of NSArray for GNUStep
|
|
||||||
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
|
|
||||||
Date: August 1994
|
|
||||||
|
|
||||||
This file is part of the GNU Objective C Class Library.
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this library; if not, write to the Free
|
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <objects/stdobjects.h>
|
|
||||||
#include <foundation/NSArray.h>
|
|
||||||
#include <objects/Array.h>
|
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
@interface NSArray (libobjects) <IndexedCollecting>
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation NSArray
|
|
||||||
|
|
||||||
+ (id) array
|
|
||||||
{
|
|
||||||
return [[[self alloc] init] autorelease];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (id) arrayWithObject: anObject
|
|
||||||
{
|
|
||||||
return [[[[self alloc] init] addObject: anObject] autorelease];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (id) arrayWithObjects: firstObject, ...
|
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
Array *n = [[self alloc] init];
|
Array *n = [[self alloc] init];
|
||||||
id o;
|
id o;
|
||||||
|
|
||||||
[n addObject:firstObject];
|
[n addObject:firstObject];
|
||||||
va_start(ap, firstObject);
|
va_start(ap, firstObject);
|
||||||
while ((o = va_arg(ap, id)))
|
while ((o = va_arg(ap, id)))
|
||||||
|
@ -312,28 +55,19 @@
|
||||||
return [n autorelease];
|
return [n autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCapacity: (unsigned)cap
|
- initWithObjects:(id *)objects count:(unsigned)count
|
||||||
{
|
{
|
||||||
[self notImplemented:_cmd];
|
[self initWithCapacity:count];
|
||||||
|
while (count--)
|
||||||
|
[self addObject:objects[count]];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithArray: (NSArray*)array
|
- initWithObjects:firstObj, ...
|
||||||
{
|
|
||||||
int i, c;
|
|
||||||
|
|
||||||
c = [array count];
|
|
||||||
[self initWithCapacity:c];
|
|
||||||
for (i = 0; i < c; i++)
|
|
||||||
[self addObject:[array objectAtIndex:i]];
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) initWithObjects: (id)firstObject, ...
|
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
id o;
|
id o;
|
||||||
|
|
||||||
[super init];
|
[super init];
|
||||||
[self addObject:firstObject];
|
[self addObject:firstObject];
|
||||||
va_start(ap, firstObject);
|
va_start(ap, firstObject);
|
||||||
|
@ -343,73 +77,48 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithObjects: (id*)objects count: (unsigned int)count
|
- initWithArray:(NSArray *)array
|
||||||
{
|
{
|
||||||
[self initWithCapacity:count];
|
int i, c;
|
||||||
while (count--)
|
|
||||||
[self addObject:objects[count]];
|
c = [array count];
|
||||||
|
[self initWithCapacity:c];
|
||||||
|
for (i = 0; i < c; i++)
|
||||||
|
[self addObject:[array objectAtIndex:i]];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) containsObject: (id)candidate
|
|
||||||
|
- (unsigned)count
|
||||||
{
|
{
|
||||||
return [self includesObject:candidate];
|
return [super count];
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
- objectAtIndex:(unsigned)index
|
||||||
- (unsigned) count; /* inherited */
|
|
||||||
- (unsigned) indexOfObject: (id)anObject; /* inherited */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
- (unsigned) indexOfObjectIdenticalTo: (id)anObject
|
|
||||||
{
|
{
|
||||||
int i;
|
return [super objectAtIndex:index];
|
||||||
for (i = 0; i < _count; i++)
|
|
||||||
if (anObject == _contents_array[i].id_u)
|
|
||||||
return i;
|
|
||||||
return UINT_MAX;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
- (unsigned)indexOfObjectIdenticalTo:anObject
|
||||||
- (id) lastObject; /* inherited */
|
|
||||||
- (id) objectAtIndex: (unsigned)index; /* inherited */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
- (NSEnumerator*) objectEnumerator
|
|
||||||
{
|
{
|
||||||
[self notImplemented:_cmd];
|
[self notImplemented:_cmd];
|
||||||
return nil;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSEnumerator*) reverseObjectEnumerator
|
- (unsigned)indexOfObject:anObject
|
||||||
{
|
{
|
||||||
[self notImplemented:_cmd];
|
return [super indexOfObject:anObject];
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
- (BOOL)containsObject:anObject
|
||||||
- (void) makeObjectsPerform: (SEL)aSelector;
|
|
||||||
- (void) makeObjectsPerform: (SEL)aSelector withObject: (id)anObject;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
- (id) firstObjectCommonWithArray: (NSArray*)otherArray
|
|
||||||
{
|
{
|
||||||
BOOL is_in_otherArray (id o)
|
return [super includesObject:anObject];
|
||||||
{
|
|
||||||
return [otherArray containsObject:o];
|
|
||||||
}
|
|
||||||
id none_found(arglist_t a)
|
|
||||||
{
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
return [self detectObjectByCalling:is_in_otherArray
|
|
||||||
ifNoneCall:none_found];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) isEqualToArray: (NSArray*)otherArray
|
- (BOOL)isEqualToArray:(NSArray *)otherArray;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (_count != [otherArray count])
|
if (_count != [otherArray count])
|
||||||
return NO;
|
return NO;
|
||||||
for (i = 0; i < _count; i++)
|
for (i = 0; i < _count; i++)
|
||||||
|
@ -418,19 +127,23 @@
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray*) sortedArrayUsingFunction: (int(*)(id,id,void*))comparator
|
- lastObject
|
||||||
context: (void*)context
|
|
||||||
{
|
{
|
||||||
id n = [self copy];
|
return [super lastObject];
|
||||||
int compare(id o1, id o2)
|
|
||||||
{
|
|
||||||
return comparator(o1, o2, context);
|
|
||||||
}
|
|
||||||
[n sortObjectsByCalling:compare];
|
|
||||||
return [n autorelease];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray*) sortedArrayUsingSelector: (SEL)comparator
|
- (void)makeObjectsPerform:(SEL)aSelector
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)makeObjectsPerform:(SEL)aSelector withObject:argument
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (NSArray *)sortedArrayUsingSelector:(SEL)comparator
|
||||||
{
|
{
|
||||||
id n = [self copy];
|
id n = [self copy];
|
||||||
int compare(id o1, id o2)
|
int compare(id o1, id o2)
|
||||||
|
@ -441,23 +154,155 @@
|
||||||
return [n autorelease];
|
return [n autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray*) subarrayWithRange: (NSRange)range
|
- (NSArray *)sortedArrayUsingFunction:(int (*)(id, id, void *))comparator
|
||||||
|
context:(void *)context
|
||||||
|
{
|
||||||
|
id n = [self copy];
|
||||||
|
int compare(id o1, id o2)
|
||||||
|
{
|
||||||
|
return comparator(o1, o2, context);
|
||||||
|
}
|
||||||
|
[n sortObjectsByCalling:compare];
|
||||||
|
return [n autorelease];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)componentsJoinedByString:(NSString *)separator
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- firstObjectCommonWithArray:(NSArray *)otherArray
|
||||||
|
{
|
||||||
|
BOOL is_in_otherArray (id o)
|
||||||
|
{
|
||||||
|
return [otherArray containsObject:o];
|
||||||
|
}
|
||||||
|
id none_found(arglist_t a)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
return [self detectObjectByCalling:is_in_otherArray
|
||||||
|
ifNoneCall:none_found];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *)subarrayWithRange:(NSRange)range
|
||||||
{
|
{
|
||||||
id n = [self emptyCopy];
|
id n = [self emptyCopy];
|
||||||
[self notImplemented:_cmd];
|
[self notImplemented:_cmd];
|
||||||
return [n autorelease];
|
return [n autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) componentsJoinedByString: (NSString*)separator
|
//- (NSEnumerator *)objectEnumerator
|
||||||
|
//{
|
||||||
|
// [self notImplemented:_cmd];
|
||||||
|
//}
|
||||||
|
|
||||||
|
//- (NSEnumerator *)reverseObjectEnumerator
|
||||||
|
//{
|
||||||
|
// [self notImplemented:_cmd];
|
||||||
|
// return 0;
|
||||||
|
//}
|
||||||
|
|
||||||
|
- (NSString *)description
|
||||||
{
|
{
|
||||||
[self notImplemented:_cmd];
|
[self notImplemented:_cmd];
|
||||||
return nil;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) description
|
- (NSString *)descriptionWithIndent:(unsigned)level
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation NSMutableArray: NSArray
|
||||||
|
|
||||||
|
+ allocWithZone:(NSZone *)zone
|
||||||
|
{
|
||||||
|
return [[[NSMutableArray alloc] init] autorelease];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ arrayWithCapacity:(unsigned)numItems
|
||||||
|
{
|
||||||
|
return [[[self alloc] initWithCapacity:numItems] autorelease];
|
||||||
|
}
|
||||||
|
|
||||||
|
- initWithCapacity:(unsigned)numItems
|
||||||
|
{
|
||||||
|
return [super initWithCapacity:numItems];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)addObject:anObject
|
||||||
|
{
|
||||||
|
[super addObject:[anObject retain]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)replaceObjectAtIndex:(unsigned)index withObject:anObject
|
||||||
|
{
|
||||||
|
id old;
|
||||||
|
old = [super replaceObjectAtIndex:index with:[anObject retain]];
|
||||||
|
[old release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeLastObject
|
||||||
|
{
|
||||||
|
[[super removeLastObject] release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)insertObject:anObject atIndex:(unsigned)index
|
||||||
|
{
|
||||||
|
[super insertObject:[anObject retain] atIndex:index];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeObjectAtIndex:(unsigned)index
|
||||||
|
{
|
||||||
|
[[super removeObjectAtIndex:index] release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeObjectIdenticalTo:anObject
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < _count; i++)
|
||||||
|
if (anObject == _contents_array[i].id_u)
|
||||||
|
return i;
|
||||||
|
return UINT_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeObject:anObject
|
||||||
|
{
|
||||||
|
[[super removeObjectAtIndex:[super indexOfObject:anObject]] release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeAllObjects
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)addObjectsFromArray:(NSArray *)otherArray
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeObjectsFromIndices:(unsigned *)indices numIndices:(unsigned)count
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeObjectsInArray:(NSArray *)otherArray
|
||||||
|
{
|
||||||
|
[self notImplemented:_cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)sortUsingFunction:(int (*)(id, id, void *))compare
|
||||||
|
context:(void *)context
|
||||||
{
|
{
|
||||||
[self notImplemented:_cmd];
|
[self notImplemented:_cmd];
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue