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
|
OF_UNRECOGNIZED_SELECTOR
}
- (id)valueForKey: (OFString *)key
{
id ret;
if ([key hasPrefix: @"@"]) {
void *pool = objc_autoreleasePoolPush();
key = [key substringWithRange: of_range(1, key.length - 1)];
ret = [[super valueForKey: key] retain];
objc_autoreleasePoolPop(pool);
return [ret autorelease];
}
ret = [OFMutableSet setWithCapacity: self.count];
for (id object in self) {
id value = [object valueForKey: key];
if (value != nil)
[ret addObject: value];
}
[ret makeImmutable];
return ret;
}
- (void)setValue: (id)value
forKey: (OFString *)key
{
if ([key hasPrefix: @"@"]) {
void *pool = objc_autoreleasePoolPush();
key = [key substringWithRange: of_range(1, key.length - 1)];
[super setValue: value
forKey: key];
objc_autoreleasePoolPop(pool);
return;
}
for (id object in self)
[object setValue: value
forKey: key];
}
- (bool)containsObject: (id)object
{
|
<
<
|
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
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
|
OF_UNRECOGNIZED_SELECTOR
}
- (id)valueForKey: (OFString *)key
{
id ret;
if ([key isEqual: @"@count"])
return [super valueForKey: @"count"];
ret = [OFMutableSet setWithCapacity: self.count];
for (id object in self) {
id value = [object valueForKey: key];
if (value != nil)
[ret addObject: value];
}
[ret makeImmutable];
return ret;
}
- (void)setValue: (id)value
forKey: (OFString *)key
{
for (id object in self)
[object setValue: value
forKey: key];
}
- (bool)containsObject: (id)object
{
|