git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15654 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-01-20 17:18:06 +00:00
parent 2aafe79eee
commit 4bd6038dd5
8 changed files with 138 additions and 47 deletions

View file

@ -113,9 +113,17 @@ static Class NSMutableSet_concrete_class;
return NSSet_abstract_class;
}
/**
* Returns a new copy of the receiver.<br />
* The default abstract implementation of a copy is to use the
* -initWithSet:copyItems: method with the flag set to YES.<br />
* Concrete subclasses generally simply retain and return the receiver.
*/
- (id) copyWithZone: (NSZone*)z
{
return RETAIN(self);
NSSet *copy = [NSSet_concrete_class allocWithZone: z];
return [copy initWithSet: self copyItems: YES];
}
/**
@ -186,9 +194,18 @@ static Class NSMutableSet_concrete_class;
return 0;
}
/**
* Returns a new instance containing the same objects as
* the receiver.<br />
* The default implementation does this by calling the
* -initWithSet:copyItems: method on a newly created object,
* and passing it NO to tell it just to retain the items.
*/
- (id) mutableCopyWithZone: (NSZone*)z
{
return [[NSMutableSet_concrete_class allocWithZone: z] initWithSet: self];
NSMutableSet *copy = [NSMutableSet_concrete_class allocWithZone: z];
return [copy initWithSet: self copyItems: NO];
}
- (NSEnumerator*) objectEnumerator
@ -493,11 +510,6 @@ static Class NSMutableSet_concrete_class;
return NSMutableSet_concrete_class;
}
- (id) copyWithZone: (NSZone*)z
{
return [[NSSet_concrete_class allocWithZone: z] initWithSet: self];
}
/** <init />
* Initialises a newly allocated set to contain no objects but
* to have space available to hold the specified number of items.<br />