Release 2.1  Copyright ã1993-1994 by Lighthouse Design, Ltd.  All Rights Reserved.

FCSortedSet

Inherits From:	FCSortedCollection : FCOrderedCollection : FCCollection : Object 

Declared In:	FCSortedSet.h 

Class Description 

FCSortedSet is a subclass of FCSortedCollection that implements the behavior of a set which automatically keeps itself sorted. A set is a unique collection of objects.  See the documentation on FCSortedCollection for a description of how sorting is accomplished. 

Some examples of sorted sets include: states sorted alphabetically, members of congress sorted by the number of years they've held office, movies not starring Michael Caine sorted by the year they came out. 

One advantage to FCSortedSet is that you don't have to enforce uniqueness yourself when you want a unique collection.  That is, you can avoid checking to see if an object already exists in the collection before adding it, because FCSortedSet does this for you in a very efficient way. 

FCSortedSet also gives the programmer an efficient solution to the problem of keeping a collection of objects sorted even after modifying the collection's contents. For example, if the object suitcase in Interface Builder were to use an FCSortedSet to store the objects you dragged in, they would stay in sorted order as you built your application, rather than the random order they currently display in. 

FCSortedSet inherits from FCSortedCollection, FCOrderedCollection, and FCCollection.  The interface documented here only covers the methods that are new or different in FCSortedSet, but all the methods from its superclasses will work on an FCSortedSet as well.  Refer to the documentation on those classes to complete the description of an FCSortedSet. 

Instance Variables 

Inherited from Object 
None declared in this class. 

Inherited from FCCollection 
id _fc_contents ; 
Class _fc_class ; 
SEL _fc_sortSelector ; 
BOOL _fc_archiveByReference ; 

Inherited from FCOrderedCollection 
None declared in this class. 

Inherited from FCSortedCollection 
None declared in this class. 

Declared in FCSortedSet 
HashTable *_fc_uniqueIds ; 

_fc_uniqueIds	maintained to do constant time inquiries for - contains: 

Method Types 

Accessing the Behavior of the Collection	
	-uniqueElements 

Instance Methods 

uniqueElements 
- (BOOL)uniqueElements;
 
Returns YES to indicate that, unlike in FCCollection, a single object may not appear multiple times in this collection (by definition of a set). 

See also:   - uniqueElements  (FCCollection)