18 OF_ASSUME_NONNULL_BEGIN
44 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
45 # define ObjectType id
54 + (instancetype)arrayWithCapacity: (
size_t)capacity;
61 - (instancetype)
init OF_DESIGNATED_INITIALIZER;
70 - (instancetype)initWithCapacity: (
size_t)capacity OF_DESIGNATED_INITIALIZER;
77 - (void)addObject: (ObjectType)object;
84 - (void)addObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)array;
92 - (void)insertObject: (ObjectType)object atIndex: (
size_t)index;
100 - (void)insertObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)array
101 atIndex: (
size_t)index;
110 - (void)replaceObject: (ObjectType)oldObject withObject: (ObjectType)newObject;
118 - (void)replaceObjectAtIndex: (
size_t)index withObject: (ObjectType)object;
130 - (void)setObject: (ObjectType)object atIndexedSubscript: (
size_t)index;
139 - (void)replaceObjectIdenticalTo: (ObjectType)oldObject
140 withObject: (ObjectType)newObject;
147 - (void)removeObject: (ObjectType)object;
155 - (void)removeObjectIdenticalTo: (ObjectType)object;
162 - (void)removeObjectAtIndex: (
size_t)index;
169 - (void)removeObjectsInRange: (
OFRange)range;
181 #ifdef OF_HAVE_BLOCKS
196 - (void)exchangeObjectAtIndex: (
size_t)index1 withObjectAtIndex: (
size_t)index2;
220 context: (nullable
void *)context
223 #ifdef OF_HAVE_BLOCKS
243 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
248 OF_ASSUME_NONNULL_END
OFArraySortOptions
Options for sorting an array.
Definition: OFArray.h:52
id(^ OFArrayReplaceBlock)(id object, size_t index)
A block for replacing values in an OFMutableArray.
Definition: OFMutableArray.h:30
OFComparisonResult(^ OFComparator)(id left, id right)
A comparator to compare two objects.
Definition: OFObject.h:82
OFComparisonResult(* OFCompareFunction)(id left, id right, void *context)
A function to compare two objects.
Definition: OFObject.h:71
An abstract class for storing objects in an array.
Definition: OFArray.h:105
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:44
void removeLastObject()
Removes the last object.
Definition: OFMutableArray.m:306
void makeImmutable()
Converts the mutable array to an immutable array.
Definition: OFMutableArray.m:420
void removeAllObjects()
Removes all objects.
Definition: OFMutableArray.m:316
instancetype init()
Initializes an OFMutableArray with no objects.
Definition: OFMutableArray.m:160
void sort()
Sorts the array in ascending order.
Definition: OFMutableArray.m:348
void reverse()
Reverts the order of the objects in the array.
Definition: OFMutableArray.m:409
A range.
Definition: OFObject.h:106