![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/gnustep-base-doc/Base/Reference/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>NSCountedSet class reference</title> </head> <body> <font face="serif"> <a href="Base.html">Up</a> <br /> <h1><a name="title$NSSet">NSCountedSet class reference</a></h1> <h3>Authors</h3> <dl> <dt>Andrew Kachites McCallum (<a href="mailto:mccallum@gnu.ai.mit.edu"><code>mccallum@gnu.ai.mit.edu</code></a>)</dt> <dd> </dd> </dl> <p><b>Copyright:</b> (C) 1995, 1996, 1998 Free Software Foundation, Inc.</p> <div> <hr width="50%" align="left" /> <h3>Contents -</h3> <ol> <li> <a href="#001000000000">Software documentation for the NSCountedSet class</a> </li> <li> <a href="#002000000000">Software documentation for the NSMutableSet class</a> </li> <li> <a href="#003000000000">Software documentation for the NSSet class</a> </li> <li> <a href="#004000000000">Software documentation for the NSCountedSet(GNU_Uniquing) category</a> </li> </ol> <hr width="50%" align="left" /> </div> <h1><a name="001000000000"> Software documentation for the NSCountedSet class </a></h1> <h2><a name="class$NSCountedSet">NSCountedSet</a> : <a rel="gsdoc" href="#class$NSMutableSet">NSMutableSet</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSSet.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> </p> <p> The <code>NSCountedSet</code> class is used to maintain a set of objects where the number of times each object has been added (without a corresponding removal) is kept track of. </p> <p> </p> <p> In GNUstep, the <code>purge</code> and <code>unique</code> methods are provided to make use of a counted set for <em>uniquing</em> objects easier. </p> <p> </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSSet.html#method$NSCountedSet(GNU_Uniquing)-purge$">-purge:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSCountedSet(GNU_Uniquing)-unique$">-unique:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSCountedSet-countForObject$">-countForObject:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSCountedSet-countForObject$">countForObject: </a></h3> - (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>) <b>countForObject:</b> (id)anObject;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the number of times that an object that is equal to the specified object (as determined by the [-isEqual:] method) has been added to the set and not removed from it. </div> <hr width="25%" align="left" /> </div> <h1><a name="002000000000"> Software documentation for the NSMutableSet class </a></h1> <h2><a name="class$NSMutableSet">NSMutableSet</a> : <a rel="gsdoc" href="#class$NSSet">NSSet</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSSet.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Mutable version of <a rel="gsdoc" href="#class$NSSet">NSSet</a> . </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet+setWithCapacity$">+setWithCapacity:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-addObject$">-addObject:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-addObjectsFromArray$">-addObjectsFromArray:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-initWithCapacity$">-initWithCapacity:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-intersectSet$">-intersectSet:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-minusSet$">-minusSet:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-removeAllObjects">-removeAllObjects</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-removeObject$">-removeObject:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-setSet$">-setSet:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSMutableSet-unionSet$">-unionSet:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSMutableSet+setWithCapacity$">setWithCapacity: </a></h3> + (instancetype) <b>setWithCapacity:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)numItems;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> New autoreleased instance with given capacity. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-addObject$">addObject: </a></h3> - (void) <b>addObject:</b> (id)anObject;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Adds <var>anObject</var> to the set. <br /> The object is retained by the set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-addObjectsFromArray$">addObjectsFromArray: </a></h3> - (void) <b>addObjectsFromArray:</b> (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*)array;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Adds all the objects in the <var>array</var> to the receiver. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-initWithCapacity$">initWithCapacity: </a></h3> - (instancetype) <b>initWithCapacity:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)numItems;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> This is a designated initialiser for the class.<br /> Subclasses <strong>must</strong> override this method.<br /> <div class="desc"> Initialises a newly allocated set to contain no objects but to have space available to hold the specified number of items. <br /> Additions of items to a set initialised with an appropriate capacity will be more efficient than addition of items otherwise. <br /> Calls <a rel="gsdoc" href="#method$NSSet-init"> -init </a> (which does nothing but maintain MacOS-X compatibility), and needs to be re-implemented in subclasses in order to have all other initialisers work. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-intersectSet$">intersectSet: </a></h3> - (void) <b>intersectSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)other;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Removes from the receiver all the objects it contains which are not also in <var>other</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-minusSet$">minusSet: </a></h3> - (void) <b>minusSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)other;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Removes from the receiver all the objects that are in <var>other</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-removeAllObjects">removeAllObjects </a></h3> - (void) <b>removeAllObjects</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Removes all objects from the receiver. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-removeObject$">removeObject: </a></h3> - (void) <b>removeObject:</b> (id)anObject;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Removes the <var>anObject</var> from the receiver. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-setSet$">setSet: </a></h3> - (void) <b>setSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)other;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Removes all objects from the receiver then adds the objects from <var>other</var>. If the receiver <em>is</em> <var>other</var>, the method has no effect. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableSet-unionSet$">unionSet: </a></h3> - (void) <b>unionSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)other;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> * Adds all the objects from <var>other</var> to the receiver. </div> <hr width="25%" align="left" /> </div> <h1><a name="003000000000"> Software documentation for the NSSet class </a></h1> <h2><a name="class$NSSet">NSSet</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSSet.h</dd> </dl> </blockquote> <blockquote> <dl> <dt><b>Conforms to:</b></dt> <dd><a rel="gsdoc" href="NSObject.html#protocol$(NSCoding)">NSCoding</a></dd> <dd><a rel="gsdoc" href="NSObject.html#protocol$(NSCopying)">NSCopying</a></dd> <dd><a rel="gsdoc" href="NSObject.html#protocol$(NSMutableCopying)">NSMutableCopying</a></dd> <dd><a rel="gsdoc" href="NSEnumerator.html#protocol$(NSFastEnumeration)">NSFastEnumeration</a></dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <code>NSSet</code> maintains an unordered collection of unique objects (according to [NSObject -isEqual:] ). When a duplicate object is added to the set, it replaces its old copy. </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSSet.html#method$NSSet+set">+set</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet+setWithArray$">+setWithArray:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet+setWithObject$">+setWithObject:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet+setWithObjects$,...">+setWithObjects:,...</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet+setWithObjects$count$">+setWithObjects:count:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet+setWithSet$">+setWithSet:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-allObjects">-allObjects</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-anyObject">-anyObject</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-containsObject$">-containsObject:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-count">-count</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-description">-description</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-descriptionWithLocale$">-descriptionWithLocale:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-enumerateObjectsUsingBlock$">-enumerateObjectsUsingBlock:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-enumerateObjectsWithOptions$usingBlock$">-enumerateObjectsWithOptions:usingBlock:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-init">-init</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-initWithArray$">-initWithArray:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-initWithObjects$,...">-initWithObjects:,...</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-initWithObjects$count$">-initWithObjects:count:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-initWithSet$">-initWithSet:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-initWithSet$copyItems$">-initWithSet:copyItems:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-intersectsSet$">-intersectsSet:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-isEqualToSet$">-isEqualToSet:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-isSubsetOfSet$">-isSubsetOfSet:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-makeObjectsPerform$">-makeObjectsPerform:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-makeObjectsPerform$withObject$">-makeObjectsPerform:withObject:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-makeObjectsPerformSelector$">-makeObjectsPerformSelector:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-makeObjectsPerformSelector$withObject$">-makeObjectsPerformSelector:withObject:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-member$">-member:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-objectEnumerator">-objectEnumerator</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-objectsPassingTest$">-objectsPassingTest:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-objectsWithOptions$passingTest$">-objectsWithOptions:passingTest:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-setByAddingObject$">-setByAddingObject:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-setByAddingObjectsFromArray$">-setByAddingObjectsFromArray:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSSet-setByAddingObjectsFromSet$">-setByAddingObjectsFromSet:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSSet+set">set </a></h3> + (instancetype) <b>set</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> New autoreleased empty set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet+setWithArray$">setWithArray: </a></h3> + (instancetype) <b>setWithArray:</b> (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*)objects;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> New set containing (unique elements of) <var>objects</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet+setWithObject$">setWithObject: </a></h3> + (instancetype) <b>setWithObject:</b> (id)anObject;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> New set containing single object <var>anObject</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet+setWithObjects$,...">setWithObjects: ,...</a></h3> + (instancetype) <b>setWithObjects:</b> (id)firstObject<b>,...</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> New set with objects in given nil-terminated list. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet+setWithObjects$count$">setWithObjects: count: </a></h3> + (instancetype) <b>setWithObjects:</b> (const id[])objects<b> count:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)count;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> New set containing (unique elements of) <var>objects</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet+setWithSet$">setWithSet: </a></h3> + (instancetype) <b>setWithSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)aSet;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Copy constructor. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-allObjects">allObjects </a></h3> - (GS_GENERIC_CLASS(NSArray,ElementT)*) <b>allObjects</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return array of all objects in set. Order is undefined. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-anyObject">anyObject </a></h3> - (GS_GENERIC_TYPE(ElementT)) <b>anyObject</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return an arbitrary object from set, or <code>nil</code> if this is empty set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-containsObject$">containsObject: </a></h3> - (BOOL) <b>containsObject:</b> (id)anObject;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return whether set contains an object equal to this one according to [NSObject -isEqual:] . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-count">count </a></h3> - (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>) <b>count</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the number of objects stored in the set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-description">description </a></h3> - (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>description</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns listing of objects in set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-descriptionWithLocale$">descriptionWithLocale: </a></h3> - (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>descriptionWithLocale:</b> (id)locale;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns listing of objects in set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-enumerateObjectsUsingBlock$">enumerateObjectsUsingBlock: </a></h3> - (void) <b>enumerateObjectsUsingBlock:</b> (GSSetEnumeratorBlock)aBlock;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.6.0</div> <br /> <div class="desc"> Enumerate over the collection using a given block. The first argument is the object. The second argument is a pointer to a BOOL indicating whether the enumeration should stop. Setting this to <code>YES</code> will interupt the enumeration. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-enumerateObjectsWithOptions$usingBlock$">enumerateObjectsWithOptions: usingBlock: </a></h3> - (void) <b>enumerateObjectsWithOptions:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSEnumerationOptions">NSEnumerationOptions</a>)opts<b> usingBlock:</b> (GSSetEnumeratorBlock)aBlock;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.6.0</div> <br /> <div class="desc"> Enumerate over the collection using the given block. The first argument is the object. The second argument is a pointer to a BOOL indicating whether the enumeration should stop. Setting this to <code>YES</code> will interrupt the enumeration. The <var>opts</var> argument is a bitfield. Setting the NSNSEnumerationConcurrent flag specifies that it is thread-safe. The NSEnumerationReverse bit specifies that it should be enumerated in reverse order. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-init">init </a></h3> - (instancetype) <b>init</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> </p> <p> In MacOS-X class clusters do not have designated initialisers, and there is a general rule that <a rel="gsdoc" href="#method$NSSet-init">-init</a> is treated as the designated initialiser of the class cluster, but that other intitialisers may not work s expected an would need to be individually overridden in any subclass. </p> <p> </p> <p> GNUstep tries to make it easier to subclass a class cluster, by making class clusters follow the same convention as normal classes, so the designated initialiser is the <em>richest</em> initialiser. This means that all other initialisers call the documented designated initialiser (which calls <a rel="gsdoc" href="#method$NSSet-init"> -init </a> only for MacOS-X compatibility), and anyone writing a subclass only needs to override that one initialiser in order to have all the other ones work. </p> <p> </p> <p> For MacOS-X compatibility, you may also need to override various other initialisers. Exactly which ones, you will need to determine by trial on a MacOS-X system... and may vary between releases of MacOS-X. So to be safe, on MacOS-X you probably need to re-implement <em>all</em> the class cluster initialisers you might use in conjunction with your subclass. </p> <p> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-initWithArray$">initWithArray: </a></h3> - (instancetype) <b>initWithArray:</b> (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*)other;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Initialises a newly allocated set by adding all the objects in the supplied array to the set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-initWithObjects$,...">initWithObjects: ,...</a></h3> - (instancetype) <b>initWithObjects:</b> (id)firstObject<b>,...</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Initialize with (unique elements of) objects in given nil-terminated list. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-initWithObjects$count$">initWithObjects: count: </a></h3> - (instancetype) <b>initWithObjects:</b> (const id[])objects<b> count:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)count;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> This is a designated initialiser for the class.<br /> Subclasses <strong>must</strong> override this method.<br /> <div class="desc"> Initialize to contain (unique elements of) <var>objects</var>. <br /> Calls <a rel="gsdoc" href="#method$NSSet-init"> -init </a> (which does nothing but maintain MacOS-X compatibility), and needs to be re-implemented in subclasses in order to have all other initialisers work. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-initWithSet$">initWithSet: </a></h3> - (instancetype) <b>initWithSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)other;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Initialize with same items as <var>other</var> (items not copied). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-initWithSet$copyItems$">initWithSet: copyItems: </a></h3> - (instancetype) <b>initWithSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)other<b> copyItems:</b> (BOOL)flag;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Initialises a newly allocated set by adding all the objects in the supplied set. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-intersectsSet$">intersectsSet: </a></h3> - (BOOL) <b>intersectsSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)otherSet;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return whether set intersection with <var>otherSet</var> is non-empty. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-isEqualToSet$">isEqualToSet: </a></h3> - (BOOL) <b>isEqualToSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)other;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return whether each set is subset of the <var>other</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-isSubsetOfSet$">isSubsetOfSet: </a></h3> - (BOOL) <b>isSubsetOfSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)otherSet;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return whether subset of <var>otherSet</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-makeObjectsPerform$">makeObjectsPerform: </a></h3> - (void) <b>makeObjectsPerform:</b> (SEL)aSelector;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Send each object given message (with no arguments). Identical to <a rel="gsdoc" href="#method$NSSet-makeObjectsPerformSelector$"> -makeObjectsPerformSelector: </a> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-makeObjectsPerform$withObject$">makeObjectsPerform: withObject: </a></h3> - (void) <b>makeObjectsPerform:</b> (SEL)aSelector<b> withObject:</b> (id)argument;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Send each object given message with given <var>argument</var>. Identical to <a rel="gsdoc" href="#method$NSSet-makeObjectsPerformSelector$withObject$">-makeObjectsPerformSelector:withObject:</a> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-makeObjectsPerformSelector$">makeObjectsPerformSelector: </a></h3> - (void) <b>makeObjectsPerformSelector:</b> (SEL)aSelector;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Send each object given message (with no arguments). Identical to <a rel="gsdoc" href="#method$NSSet-makeObjectsPerform$"> -makeObjectsPerform: </a> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-makeObjectsPerformSelector$withObject$">makeObjectsPerformSelector: withObject: </a></h3> - (void) <b>makeObjectsPerformSelector:</b> (SEL)aSelector<b> withObject:</b> (id)argument;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Send each object given message with given <var>argument</var>. Identical to <a rel="gsdoc" href="#method$NSSet-makeObjectsPerform$withObject$"> -makeObjectsPerform:withObject: </a> . </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-member$">member: </a></h3> - (GS_GENERIC_TYPE(ElementT)) <b>member:</b> (id)anObject;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> If <var>anObject</var> is in set, return it (the copy in the set). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-objectEnumerator">objectEnumerator </a></h3> - (GS_GENERIC_CLASS(NSEnumerator,ElementT)*) <b>objectEnumerator</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return enumerator over objects in set. Order is undefined. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-objectsPassingTest$">objectsPassingTest: </a></h3> - (GS_GENERIC_CLASS(NSSet,ElementT)*) <b>objectsPassingTest:</b> (GSSetFilterBlock)aBlock;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.6.0</div> <br /> <div class="desc"> <em>Description forthcoming.</em> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-objectsWithOptions$passingTest$">objectsWithOptions: passingTest: </a></h3> - (GS_GENERIC_CLASS(NSSet,ElementT)*) <b>objectsWithOptions:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSEnumerationOptions">NSEnumerationOptions</a>)opts<b> passingTest:</b> (GSSetFilterBlock)aBlock;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.6.0</div> <br /> <div class="desc"> <em>Description forthcoming.</em> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-setByAddingObject$">setByAddingObject: </a></h3> - (GS_GENERIC_CLASS(NSSet,ElementT)*) <b>setByAddingObject:</b> (id)anObject;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Return a set formed by adding <var>anObject</var> to the receiver. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-setByAddingObjectsFromArray$">setByAddingObjectsFromArray: </a></h3> - (GS_GENERIC_CLASS(NSSet,ElementT)*) <b>setByAddingObjectsFromArray:</b> (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*)other;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Return a set formed by adding the contents of <var>other</var> to the receiver. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSSet-setByAddingObjectsFromSet$">setByAddingObjectsFromSet: </a></h3> - (GS_GENERIC_CLASS(NSSet,ElementT)*) <b>setByAddingObjectsFromSet:</b> (<a rel="gsdoc" href="#class$NSSet">NSSet</a>*)other;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> Return a set formed as a union of the receiver and <var>other</var>. </div> <hr width="25%" align="left" /> </div> <h1><a name="004000000000"> Software documentation for the NSCountedSet(GNU_Uniquing) category </a></h1> <h2><a rel="gsdoc" href="#class$NSCountedSet">NSCountedSet</a>(<a name="category$NSCountedSet(GNU_Uniquing)">GNU_Uniquing</a>)</h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSSet.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> Not in OpenStep/MacOS-X</div> <br /> <div class="desc"> Utility methods for using a counted set to handle uniquing of objects. </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSSet.html#method$NSCountedSet(GNU_Uniquing)-purge$">-purge:</a></li> <li><a rel="gsdoc" href="NSSet.html#method$NSCountedSet(GNU_Uniquing)-unique$">-unique:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSCountedSet(GNU_Uniquing)-purge$">purge: </a></h3> - (void) <b>purge:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSInteger">NSInteger</a>)level;<br /> <div class="availability"> <b>Availability:</b> Not in OpenStep/MacOS-X</div> <br /> <div class="desc"> </p> <p> This method removes from the set all objects whose count is less than or equal to the specified value. </p> <p> </p> <p> This is useful where a counted set is used for uniquing objects. The set can be periodically purged of objects that have only been added once - and are therefore simply wasting space. </p> <p> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSCountedSet(GNU_Uniquing)-unique$">unique: </a></h3> - (GS_GENERIC_TYPE(ElementT)) <b>unique:</b> (GS_GENERIC_TYPE(ElementT))anObject;<br /> <div class="availability"> <b>Availability:</b> Not in OpenStep/MacOS-X</div> <br /> <div class="desc"> </p> <p> If the supplied object (or one equal to it as determined by the [NSObject -isEqual:] method) is already present in the set, the count for that object is incremented, the supplied object is released, and the object in the set is retained and returned. Otherwise, the supplied object is added to the set and returned. </p> <p> </p> <p> This method is useful for uniquing objects - the init method of a class need simply end with - <code>return [myUniquingSet unique: self];</code> </p> <p> </div> <hr width="25%" align="left" /> </div> <br /> <a href="Base.html">Up</a> </font> </body> </html>