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(LIST_OL_GUARD)
00044 #define LIST_OL_GUARD
00045
00046 #include <ObjectiveLib/Functional.h>
00047 #include <ObjectiveLib/Iterator.h>
00048
00052 @class OLListNode;
00053
00064 @interface OLListIterator : OLBidirectionalIterator
00065 {
00066 @private
00071 OLListNode* node;
00072 }
00073
00074 - (id) advance;
00075 - (id) assign: (id)object;
00076 #if defined(OL_NO_OPENSTEP)
00077 - (id) copy;
00078 #else
00079 - (id) copyWithZone: (NSZone*)zone;
00080 #endif
00081 - (id) dereference;
00082 - (BOOL) isEqual: (id)object;
00083 - (id) reverse;
00084
00085 @end
00086
00103 @interface OLList :
00104 #if defined(OL_NO_OPENSTEP)
00105 Object <OLBackInserter, OLFrontInserter, OLInserter, OLStreamable>
00106 #else
00107 NSObject <OLBackInserter, OLFrontInserter, OLInserter, OLStreamable, NSCopying, NSCoding>
00108 #endif
00109 {
00110 @protected
00114 OLListNode* node;
00115 }
00116
00125 + (id) list;
00126
00138 + (id) listFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00139
00150 + (id) listWithList: (OLList*)right;
00151
00163 + (id) listWithSize: (unsigned)size filledWith: (id)value;
00164
00168
00174 - (id) init;
00175
00184 - (id) initFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00185
00186 #if !defined(OL_NO_OPENSTEP)
00187
00197 - (id) initWithCoder: (NSCoder*)decoder;
00198 #endif
00199
00207 - (id) initWithList: (OLList*)list;
00208
00209 - (id) initWithObjectInStream: (OLObjectInStream*)stream;
00210
00219 - (id) initWithSize: (unsigned)size filledWith: (id)value;
00220
00224 #if defined(OL_NO_OPENSTEP)
00225 - (id) free;
00226 #else
00227 - (void) dealloc;
00228 #endif
00229
00230
00238 - (void) assign: (unsigned)count filledWith: (id)value;
00239
00248 - (void) assignFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00249
00258 - (id) back;
00259
00268 - (OLListIterator*) begin;
00269
00273 - (void) clear;
00274
00284 - (int) compare: (id)other;
00285
00286 #if defined(OL_NO_OPENSTEP)
00287
00292 - (id) copy;
00293 #else
00294
00300 - (id) copyWithZone: (NSZone*)zone;
00301 #endif
00302
00308 - (BOOL) empty;
00309
00310 #if !defined(OL_NO_OPENSTEP)
00311
00317 - (void) encodeWithCoder: (NSCoder*)encoder;
00318 #endif
00319
00328 - (OLListIterator*) end;
00329
00341 - (OLListIterator*) erase: (OLListIterator*)where;
00342
00357 - (OLListIterator*) eraseFrom: (OLListIterator*)first to: (OLListIterator*)last;
00358
00367 - (id) front;
00368
00380 - (void) insertAt: (OLListIterator*)where count: (unsigned)num filledWith: (id)value;
00381
00391 - (void) insertAt: (OLListIterator*)where from: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00392
00407 - (OLListIterator*) insertAt: (OLListIterator*)where value: (id)object;
00408
00417 - (BOOL) isEqual: (id)object;
00418
00427 - (unsigned) maxSize;
00428
00439 - (void) merge: (OLList*)right;
00440
00450 - (void) merge: (OLList*)right withOrder: (id<OLBoolBinaryFunction>)pred;
00451
00458 - (void) popBack;
00459
00466 - (void) popFront;
00467
00473 - (void) pushBack: (id)object;
00474
00480 - (void) pushFront: (id)object;
00481
00492 - (OLReverseBidiIterator*) rbegin;
00493
00503 - (void) remove: (id)object;
00504
00513 - (void) removeIf: (id<OLBoolUnaryFunction>)pred;
00514
00525 - (OLReverseBidiIterator*) rend;
00526
00536 - (void) resize: (unsigned)count filledWith: (id)value;
00537
00541 - (void) reverse;
00542
00548 - (unsigned) size;
00549
00554 - (void) sort;
00555
00562 - (void) sortWith: (id<OLBoolBinaryFunction>)pred;
00563
00573 - (void) spliceAt: (OLListIterator*)where list: (OLList*)right;
00574
00586 - (void) spliceAt: (OLListIterator*)where list: (OLList*)right from: (OLListIterator*)first;
00587
00601 - (void) spliceAt: (OLListIterator*)where list: (OLList*)right from: (OLListIterator*)first to: (OLListIterator*)last;
00602
00609 - (void) swap: (OLList*)right;
00610
00616 - (void) unique;
00617
00625 - (void) uniqueWith: (id<OLBoolBinaryFunction>)pred;
00626
00627 - (void) writeSelfToStream: (OLObjectOutStream*)stream;
00628
00629 @end
00630
00631 #endif