18 - (id)initWithCapacity:(
unsigned)aCapacity
27 + (id)setWithCapacity:(CPUInteger)aCapacity
29 return [[
self alloc] initWithCapacity:aCapacity];
31 - (void)filterUsingPredicate:(
CPPredicate)aPredicate
38 objectEnumerator = [
self objectEnumerator];
40 while ((
object = [objectEnumerator nextObject]) !== nil)
41 if (![aPredicate evaluateWithObject:
object])
42 [
self removeObject:object];
49 - (void)removeObject:(
id)anObject
51 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
58 - (void)removeObjectsInArray:(
CPArray)anArray
61 count = [anArray
count];
63 for (; index < count; ++index)
64 [
self removeObject:[anArray objectAtIndex:index]];
70 - (void)removeAllObjects
75 while ((
object = [objectEnumerator nextObject]) !== nil)
83 - (void)addObjectsFromArray:(
CPArray)objects
85 var count = [objects
count];
88 [
self addObject:objects[count]];
100 while ((
object = [objectEnumerator nextObject]) !== nil)
101 [
self addObject:object];
113 while ((
object = [objectEnumerator nextObject]) !== nil)
125 objectsToRemove = [];
127 while ((
object = [objectEnumerator nextObject]) !== nil)
128 if (![aSet containsObject:
object])
129 objectsToRemove.push(
object);
131 var count = [objectsToRemove count];