(Preliminary Documentation) Copyright ã1994 by NeXT Computer, Inc.  All Rights Reserved.

NSCountedSet 

Inherits From:	NSMutableSet 

Conforms To:	NSCopying
NSCoding
NSMutableCopying
NSObject 

Declared In:	foundation/NSSet.h 

Initializing an NSCountedSet

- (id)initWithArray:(NSArray *)anArray	Initializes a newly allocated set object by placing in it the objects contained in anArray.
- (id)initWithCapacity:(unsigned int)numItems	Initializes a newly allocated set object, giving it enough memory to hold numItems objects.
- (id)initWithSet:(NSSet *)anotherSet	Initializes a newly allocated set object by placing in it the objects contained in anotherSet.

Adding Objects	

- (void)addObject:(id)anObject	Adds anObject to the set, unless anObject is equal to some object already in the set. In either case, the counter that's returned by countForObject: is incremented.

Removing Objects

- (void)removeObject:(id)anObject	Decrements the counter for the object, if the set contains an object that's equal to anObject. If this causes the counter to reach zero, the object that's equal to anObject is removed from the set.

Querying the NSCountedSet

- (unsigned int)countForObject:(id)anObject	Returns the number of times that an object equal to anObject has ostensibly been added to the set. (This number is incremented by addObject: and decremented by removeObject:.)
- (NSEnumerator *)objectEnumerator	Returns an enumerator object that will access each object in the set only once, regardless of its count.