#include <OOFilteringEnumerator.h>
Definition at line 57 of file OOFilteringEnumerator.h.
◆ dealloc
Definition at line 33 of file OOFilteringEnumerator.m.
82{
83 [_underlyingEnum release];
84 [_argument release];
85
86 [super dealloc];
87}
◆ descriptionComponents
- (NSString *) descriptionComponents |
|
|
|
|
implementation |
Definition at line 33 of file OOFilteringEnumerator.m.
91{
92 NSString *subDesc = NSStringFromSelector(
_selector);
94 {
95 subDesc = [subDesc stringByAppendingString:[_argument shortDescription]];
96 }
97
98 return [NSString stringWithFormat:@"%@ matching %@", [_underlyingEnum shortDescription], subDesc];
99}
◆ filterEnumerator:withSelector:
+ (id) filterEnumerator: |
|
(NSEnumerator *) | enumerator |
withSelector: |
|
(SEL) | selector |
Definition at line 33 of file OOFilteringEnumerator.m.
38 :(NSEnumerator *)enumerator withSelector:(SEL)selector
39{
40 if (selector == NULL) return [[enumerator retain] autorelease];
41
42 return [[[self alloc] initWithUnderlyingEnumerator:enumerator
43 withSelector:selector
44 takingArgument:NO
45 argumentValue:nil]
46 autorelease];
47}
◆ filterEnumerator:withSelector:andArgument:
+ (id) filterEnumerator: |
|
(NSEnumerator *) | enumerator |
withSelector: |
|
(SEL) | selector |
andArgument: |
|
(id) | argument |
Definition at line 33 of file OOFilteringEnumerator.m.
50 :(NSEnumerator *)enumerator withSelector:(SEL)selector andArgument:(id)argument
51{
52 if (selector == NULL) return [[enumerator retain] autorelease];
53
54 return [[[self alloc] initWithUnderlyingEnumerator:enumerator
55 withSelector:selector
56 takingArgument:YES
57 argumentValue:argument]
58 autorelease];
59}
◆ initWithUnderlyingEnumerator:withSelector:takingArgument:argumentValue:
- (id) initWithUnderlyingEnumerator: |
|
(NSEnumerator *) | enumerator |
withSelector: |
|
(SEL) | selector |
takingArgument: |
|
(BOOL) | takesArgument |
argumentValue: |
|
(id) | argument |
Definition at line 33 of file OOFilteringEnumerator.m.
61 :(NSEnumerator *)enumerator
62 withSelector:(SEL)selector
63 takingArgument:(BOOL)takesArgument
64 argumentValue:(id)argument
65{
66 self = [super init];
68 {
73 {
75 }
76 }
77 return self;
78}
NSEnumerator * _underlyingEnum
◆ nextObject
Definition at line 33 of file OOFilteringEnumerator.m.
109{
110 for (;;)
111 {
112
113 id obj = [_underlyingEnum nextObject];
114 BOOL filter;
115
117 {
118
120 {
121 [_underlyingEnum release];
123 [_argument release];
125 }
127 }
128
129
130 IMP predicate = [obj methodForSelector:_selector];
131 if (predicate != NULL)
132 {
134 {
136 }
137 else
138 {
140 }
141 }
142 else
143 {
144
145 filter = NO;
146 }
147
148
149 if (filter) return obj;
150 }
151}
BOOL(* BoolReturnMsgSend)(id, SEL)
BOOL(* BoolReturnWithParamMsgSend)(id, SEL, id)
◆ shortDescriptionComponents
- (NSString *) shortDescriptionComponents |
|
|
|
|
implementation |
◆ _argument
◆ _selector
◆ _takesArgument
◆ _underlyingEnum
- (NSEnumerator*) _underlyingEnum |
|
private |
The documentation for this class was generated from the following files: