22 OF_ASSUME_NONNULL_BEGIN
50 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
51 # define ObjectType id
60 + (instancetype)arrayWithCapacity: (
size_t)capacity;
67 - (instancetype)
init OF_DESIGNATED_INITIALIZER;
76 - (instancetype)initWithCapacity: (
size_t)capacity OF_DESIGNATED_INITIALIZER;
83 - (void)addObject: (ObjectType)object;
90 - (void)addObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)array;
98 - (void)insertObject: (ObjectType)object atIndex: (
size_t)index;
106 - (void)insertObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)array
107 atIndex: (
size_t)index;
116 - (void)insertObjects: (
OFArray OF_GENERIC(ObjectType) *)array
126 - (void)replaceObject: (ObjectType)oldObject withObject: (ObjectType)newObject;
134 - (void)replaceObjectAtIndex: (
size_t)index withObject: (ObjectType)object;
143 - (void)replaceObjectsInRange: (
OFRange)range
144 withObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)objects;
153 - (void)replaceObjectsAtIndexes: (
OFIndexSet *)indexes
154 withObjects: (
OFArray OF_GENERIC(ObjectType) *)objects;
166 - (void)setObject: (ObjectType)object atIndexedSubscript: (
size_t)index;
175 - (void)replaceObjectIdenticalTo: (ObjectType)oldObject
176 withObject: (ObjectType)newObject;
183 - (void)removeObject: (ObjectType)object;
191 - (void)removeObjectIdenticalTo: (ObjectType)object;
198 - (void)removeObjectAtIndex: (
size_t)index;
205 - (void)removeObjectsInRange: (
OFRange)range;
212 - (void)removeObjectsAtIndexes: (
OFIndexSet *)indexes;
224 #ifdef OF_HAVE_BLOCKS
239 - (void)exchangeObjectAtIndex: (
size_t)index1 withObjectAtIndex: (
size_t)index2;
263 context: (nullable
void *)context
266 #ifdef OF_HAVE_BLOCKS
286 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
291 OF_ASSUME_NONNULL_END
OFArraySortOptions
Options for sorting an array.
Definition: OFArray.h:57
id(^ OFArrayReplaceBlock)(id object, size_t index)
A block for replacing values in an OFMutableArray.
Definition: OFMutableArray.h:36
OFComparisonResult(^ OFComparator)(id left, id right)
A comparator to compare two objects.
Definition: OFObject.h:92
OFComparisonResult(* OFCompareFunction)(id left, id right, void *context)
A function to compare two objects.
Definition: OFObject.h:81
An abstract class for storing objects in an array.
Definition: OFArray.h:110
A class storing a set of indexes as sorted ranges.
Definition: OFIndexSet.h:31
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:50
void removeLastObject()
Removes the last object.
Definition: OFMutableArray.m:380
void makeImmutable()
Converts the mutable array to an immutable array.
Definition: OFMutableArray.m:494
void removeAllObjects()
Removes all objects.
Definition: OFMutableArray.m:390
instancetype init()
Initializes an OFMutableArray with no objects.
Definition: OFMutableArray.m:168
void sort()
Sorts the array in ascending order.
Definition: OFMutableArray.m:422
void reverse()
Reverts the order of the objects in the array.
Definition: OFMutableArray.m:483
A range.
Definition: OFObject.h:116