diff --git a/ChangeLog b/ChangeLog index c25f95180..265beb9b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,8 +3,9 @@ * Source/NSGSet.m: renamed to GSSet.m for consistency, tidied. * Source/NSGCountedSet.m: renamed to GSCountedSet.m for consistency. * Headers/Foundation/NSGSet.h: removed - obsolete. + * Headers/Foundation/NSSet.h: si9mplified back to single class * Source/NSSet.m: Updated and tidied. Fixed coding class for - mutable sets. + mutable sets. Removed non-core classes. 2000-12-05 Richard Frith-Macdonald diff --git a/Headers/gnustep/base/NSSet.h b/Headers/gnustep/base/NSSet.h index 6c12e2521..5a90c9725 100644 --- a/Headers/gnustep/base/NSSet.h +++ b/Headers/gnustep/base/NSSet.h @@ -36,34 +36,29 @@ + (id) setWithObjects: (id)anObject, ...; + (id) setWithSet: (NSSet*)aSet; -- (id) initWithObjects: (id*)objects - count: (unsigned)count; -- (unsigned) count; -- (id) member: (id)anObject; -- (NSEnumerator*) objectEnumerator; - -@end - -@interface NSSet (NonCore) - -- (id) initWithArray: (NSArray*)array; -- (id) initWithObjects: (id)objects, ...; -- (id) initWithObjects: firstObject rest: (va_list)ap; -- (id) initWithSet: (NSSet*)otherSet; -- (id) initWithSet: (NSSet*)otherSet copyItems: (BOOL)flags; - - (NSArray*) allObjects; - (id) anyObject; - (BOOL) containsObject: (id)anObject; -- (void) makeObjectsPerform: (SEL)aSelector; -- (void) makeObjectsPerform: (SEL)aSelector withObject: (id)argument; +- (unsigned) count; +- (NSString*) descriptionWithLocale: (NSDictionary*)ld; +- (id) initWithArray: (NSArray*)array; +- (id) initWithObjects: (id)objects, ...; +- (id) initWithObjects: (id*)objects + count: (unsigned)count; +- (id) initWithObjects: firstObject + rest: (va_list)ap; +- (id) initWithSet: (NSSet*)otherSet; +- (id) initWithSet: (NSSet*)otherSet copyItems: (BOOL)flags; - (BOOL) intersectsSet: (NSSet*)other; - (BOOL) isEqualToSet: (NSSet*)other; - (BOOL) isSubsetOfSet: (NSSet*)other; -- (NSString*) descriptionWithLocale: (NSDictionary*)ld; +- (void) makeObjectsPerform: (SEL)aSelector; +- (void) makeObjectsPerform: (SEL)aSelector withObject: (id)argument; +- (id) member: (id)anObject; +- (NSEnumerator*) objectEnumerator; @end @@ -71,19 +66,14 @@ + (id) setWithCapacity: (unsigned)numItems; -- (id) initWithCapacity: (unsigned)numItems; - (void) addObject: (id)anObject; -- (void) removeObject: (id)anObject; - -@end - -@interface NSMutableSet (NonCore) - - (void) addObjectsFromArray: (NSArray*)array; -- (void) unionSet: (NSSet*)other; +- (id) initWithCapacity: (unsigned)numItems; - (void) intersectSet: (NSSet*)other; - (void) minusSet: (NSSet*)other; - (void) removeAllObjects; +- (void) removeObject: (id)anObject; +- (void) unionSet: (NSSet*)other; @end @@ -112,7 +102,7 @@ * GSUnique() returns an object that is equal to the one passed to it. * If the returned object is not the same object as the object passed in, * the original object is released and the returned object is retained. - * Thus, an -init metod that wants to implement uniquing simply needs + * Thus, an -init method that wants to implement uniquing simply needs * to end with 'return GSUnique(self);' */ void GSUniquing(BOOL flag); diff --git a/Source/GSCountedSet.m b/Source/GSCountedSet.m index 79dc51239..d434d41ae 100644 --- a/Source/GSCountedSet.m +++ b/Source/GSCountedSet.m @@ -39,9 +39,6 @@ #include -@class NSSetNonCore; -@class NSMutableSetNonCore; - @interface GSCountedSet : NSCountedSet { @public @@ -96,8 +93,6 @@ { if (self == [GSCountedSet class]) { - class_add_behavior(self, [NSSetNonCore class]); - class_add_behavior(self, [NSMutableSetNonCore class]); } } diff --git a/Source/GSSet.m b/Source/GSSet.m index 5eb08ffb9..5cf187129 100644 --- a/Source/GSSet.m +++ b/Source/GSSet.m @@ -39,9 +39,6 @@ #include -@class NSSetNonCore; -@class NSMutableSetNonCore; - @interface GSSet : NSSet { @public @@ -107,7 +104,6 @@ static Class mutableSetClass; { if (self == [GSSet class]) { - class_add_behavior(self, [NSSetNonCore class]); arrayClass = [NSArray class]; setClass = [GSSet class]; mutableSetClass = [GSMutableSet class]; @@ -424,7 +420,6 @@ static Class mutableSetClass; { if (self == [GSMutableSet class]) { - class_add_behavior(self, [NSMutableSetNonCore class]); class_add_behavior(self, [GSSet class]); } } diff --git a/Source/NSCountedSet.m b/Source/NSCountedSet.m index f63dedce5..b71dfe8fd 100644 --- a/Source/NSCountedSet.m +++ b/Source/NSCountedSet.m @@ -33,8 +33,6 @@ #include #include -@class NSSetNonCore; -@class NSMutableSetNonCore; @class GSCountedSet; /* @@ -62,8 +60,6 @@ static Class NSCountedSet_concrete_class; { NSCountedSet_abstract_class = self; NSCountedSet_concrete_class = [GSCountedSet class]; - behavior_class_add_class(self, [NSMutableSetNonCore class]); - behavior_class_add_class(self, [NSSetNonCore class]); if ([NSThread isMultiThreaded]) { [self _becomeThreaded: nil]; diff --git a/Source/NSSet.m b/Source/NSSet.m index 170f3bed8..ea24aaa13 100644 --- a/Source/NSSet.m +++ b/Source/NSSet.m @@ -34,11 +34,6 @@ @class GSSet; @class GSMutableSet; -@interface NSSetNonCore : NSSet -@end -@interface NSMutableSetNonCore: NSMutableSet -@end - @implementation NSSet static Class NSSet_abstract_class; @@ -66,7 +61,6 @@ static Class NSMutableSet_concrete_class; NSMutableSet_abstract_class = [NSMutableSet class]; NSSet_concrete_class = [GSSet class]; NSMutableSet_concrete_class = [GSMutableSet class]; - behavior_class_add_class(self, [NSSetNonCore class]); } } @@ -195,10 +189,6 @@ static Class NSMutableSet_concrete_class; return [self subclassResponsibility: _cmd]; } -@end - -@implementation NSSetNonCore - /* Same as NSArray */ - (id) initWithObjects: firstObject rest: (va_list)ap { @@ -462,8 +452,6 @@ static Class NSMutableSet_concrete_class; { if (self == [NSMutableSet class]) { - behavior_class_add_class(self, [NSMutableSetNonCore class]); - behavior_class_add_class(self, [NSSetNonCore class]); } } @@ -511,10 +499,6 @@ static Class NSMutableSet_concrete_class; [self subclassResponsibility: _cmd]; } -@end - -@implementation NSMutableSetNonCore - - (id) initWithObjects: (id*)objects count: (unsigned)count {