/usr/share/GNUstep/Documentation/Developer/Base/Reference/NSSet.html is in gnustep-base-doc 1.25.1-2ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 | <!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>
|