28 + (id)indexPathWithIndex:(
int)index
33 + (id)indexPathWithIndexes:(CPArray)indexes length:(
int)length
38 + (id)indexPathWithIndexes:(CPArray)indexes
43 - (id)initWithIndexes:(CPArray)indexes length:(
int)length
48 _indexes = [
indexes subarrayWithRange:CPMakeRange(0, length)];
53 - (id)initWithIndexes:(CPArray)indexes
69 #pragma mark Accessing
73 return [_indexes count];
76 - (int)indexAtPosition:(
int)position
78 return [_indexes objectAtIndex:position];
81 - (void)setIndexes:(CPArray)theIndexes
83 _indexes = [theIndexes copy];
88 return [_indexes copy];
92 #pragma mark Modification
105 #pragma mark Comparison
109 if (anObject ===
self)
115 return [_indexes isEqualToArray:[anObject indexes]];
123 var lhsIndexes = [
self indexes],
124 rhsIndexes = [anIndexPath
indexes],
125 lhsCount = [lhsIndexes count],
126 rhsCount = [rhsIndexes count];
129 count = MIN(lhsCount, rhsCount);
131 for (; index < count; ++index)
133 var lhs = lhsIndexes[index],
134 rhs = rhsIndexes[index];
143 if (lhsCount === rhsCount)
146 if (lhsCount === count)
160 if (
self = [
self init])
162 _indexes = [theCoder decodeObjectForKey:CPIndexPathIndexesKey];
170 [theCoder encodeObject:_indexes forKey:CPIndexPathIndexesKey];
188 - (void)setIndexes:(CPArray)aValue