00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #if !defined(SET_OL_GUARD)
00044 #define SET_OL_GUARD
00045
00046 #include <ObjectiveLib/Iterator.h>
00047 #include <ObjectiveLib/Pair.h>
00048 #include <ObjectiveLib/Functional.h>
00049
00053 @class OLTree;
00054
00069 @interface OLSet :
00070 #if defined(OL_NO_OPENSTEP)
00071 Object <OLInserter, OLStreamable>
00072 #else
00073 NSObject <OLInserter, OLStreamable, NSCopying, NSCoding>
00074 #endif
00075 {
00076 @protected
00080 OLTree* tree;
00081 }
00082
00092 + (id) set;
00093
00106 + (id) setFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00107
00118 + (id) setWithCompare: (OLStreamableFunctor<OLBoolBinaryFunction>*)comp;
00119
00130 + (id) setWithOLSet: (OLSet*)right;
00131
00135
00141 - (id) init;
00142
00153 - (id) initFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00154
00166 - (id) initFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last compare: (OLStreamableFunctor<OLBoolBinaryFunction>*)comp;
00167
00168 #if !defined(OL_NO_OPENSTEP)
00169
00179 - (id) initWithCoder: (NSCoder*)decoder;
00180 #endif
00181
00189 - (id) initWithCompare: (OLStreamableFunctor<OLBoolBinaryFunction>*)comp;
00190
00191 - (id) initWithObjectInStream: (OLObjectInStream*)stream;
00192
00200 - (id) initWithOLSet: (OLSet*)set;
00201
00205 #if defined(OL_NO_OPENSTEP)
00206 - (id) free;
00207 #else
00208 - (void) dealloc;
00209 #endif
00210
00211
00220 - (OLAssociativeIterator*) begin;
00221
00225 - (void) clear;
00226
00236 - (int) compare: (id)other;
00237
00238 #if defined(OL_NO_OPENSTEP)
00239
00244 - (id) copy;
00245 #else
00246
00252 - (id) copyWithZone: (NSZone*)zone;
00253 #endif
00254
00261 - (unsigned) count: (id)key;
00262
00268 - (BOOL) empty;
00269
00270 #if !defined(OL_NO_OPENSTEP)
00271
00277 - (void) encodeWithCoder: (NSCoder*)encoder;
00278 #endif
00279
00288 - (OLAssociativeIterator*) end;
00289
00301 - (OLPair*) equalRange: (id)key;
00302
00310 - (void) erase: (OLAssociativeIterator*)where;
00311
00321 - (void) eraseFrom: (OLAssociativeIterator*)first to: (OLAssociativeIterator*)last;
00322
00330 - (unsigned) eraseKey: (id)key;
00331
00344 - (OLAssociativeIterator*) find: (id)key;
00345
00361 - (id) insert: (id)object;
00362
00377 - (OLAssociativeIterator*) insertAt: (OLAssociativeIterator*)where value: (id)object;
00378
00388 - (void) insertFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00389
00398 - (BOOL) isEqual: (id)object;
00399
00405 - (OLStreamableFunctor<OLBoolBinaryFunction>*) keyComp;
00406
00418 - (OLAssociativeIterator*) lowerBound: (id)key;
00419
00428 - (unsigned) maxSize;
00429
00440 - (OLReverseBidiIterator*) rbegin;
00441
00452 - (OLReverseBidiIterator*) rend;
00453
00459 - (unsigned) size;
00460
00467 - (void) swap: (OLSet*)right;
00468
00480 - (OLAssociativeIterator*) upperBound: (id)key;
00481
00488 - (OLStreamableFunctor<OLBoolBinaryFunction>*) valueComp;
00489
00490 - (void) writeSelfToStream: (OLObjectOutStream*)stream;
00491
00492 @end
00493
00504 @interface OLMultiSet : OLSet
00505 {
00506 }
00507
00517 + (id) multiSet;
00518
00531 + (id) multiSetFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00532
00543 + (id) multiSetWithCompare: (OLStreamableFunctor<OLBoolBinaryFunction>*)comp;
00544
00557 + (id) multiSetWithOLSet: (OLSet*)right;
00558
00570 - (id) insert: (id)object;
00571 - (OLAssociativeIterator*) insertAt: (OLAssociativeIterator*)where value: (id)object;
00572 - (void) insertFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00573 - (BOOL) isEqual: (id)object;
00574
00575 @end
00576
00577 #endif