17 - (id)initWithCapacity:(
unsigned)aCapacity
26 + (id)setWithCapacity:(CPUInteger)aCapacity
28 return [[
self alloc] initWithCapacity:aCapacity];
30 - (void)filterUsingPredicate:(CPPredicate)aPredicate
37 objectEnumerator = [
self objectEnumerator];
39 while ((
object = [objectEnumerator nextObject]) !== nil)
40 if (![aPredicate evaluateWithObject:
object])
41 [
self removeObject:object];
48 - (void)removeObject:(
id)anObject
50 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
57 - (void)removeObjectsInArray:(CPArray)anArray
60 count = [anArray count];
62 for (; index < count; ++index)
63 [
self removeObject:[anArray objectAtIndex:index]];
69 - (void)removeAllObjects
72 objectEnumerator = [
self objectEnumerator];
74 while ((
object = [objectEnumerator nextObject]) !== nil)
82 - (void)addObjectsFromArray:(CPArray)objects
84 var count = [objects count];
87 [
self addObject:objects[count]];
94 - (void)unionSet:(CPSet)aSet
97 objectEnumerator = [aSet objectEnumerator];
99 while ((
object = [objectEnumerator nextObject]) !== nil)
100 [
self addObject:object];
107 - (void)minusSet:(CPSet)aSet
110 objectEnumerator = [aSet objectEnumerator];
112 while ((
object = [objectEnumerator nextObject]) !== nil)
120 - (void)intersectSet:(CPSet)aSet
123 objectEnumerator = [
self objectEnumerator],
124 objectsToRemove = [];
126 while ((
object = [objectEnumerator nextObject]) !== nil)
127 if (![aSet containsObject:
object])
128 objectsToRemove.push(
object);
130 var count = [objectsToRemove count];
140 - (void)setSet:(CPSet)aSet
void unionSet:(CPSet aSet)
void removeObject:(id anObject)