22 OF_ASSUME_NONNULL_BEGIN
48 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) 49 # define ObjectType id 58 + (instancetype)arrayWithCapacity: (
size_t)capacity;
65 - (instancetype)
init OF_DESIGNATED_INITIALIZER;
74 - (instancetype)initWithCapacity: (
size_t)capacity OF_DESIGNATED_INITIALIZER;
81 - (void)addObject: (ObjectType)object;
88 - (void)addObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)array;
96 - (void)insertObject: (ObjectType)object atIndex: (
size_t)index;
104 - (void)insertObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)array
105 atIndex: (
size_t)index;
114 - (void)replaceObject: (ObjectType)oldObject withObject: (ObjectType)newObject;
122 - (void)replaceObjectAtIndex: (
size_t)index withObject: (ObjectType)object;
134 - (void)setObject: (ObjectType)object atIndexedSubscript: (
size_t)index;
143 - (void)replaceObjectIdenticalTo: (ObjectType)oldObject
144 withObject: (ObjectType)newObject;
151 - (void)removeObject: (ObjectType)object;
159 - (void)removeObjectIdenticalTo: (ObjectType)object;
166 - (void)removeObjectAtIndex: (
size_t)index;
173 - (void)removeObjectsInRange: (
OFRange)range;
185 #ifdef OF_HAVE_BLOCKS 200 - (void)exchangeObjectAtIndex: (
size_t)index1 withObjectAtIndex: (
size_t)index2;
224 context: (nullable
void *)context
227 #ifdef OF_HAVE_BLOCKS 247 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) 252 OF_ASSUME_NONNULL_END
id(^ OFArrayReplaceBlock)(id object, size_t index)
A block for replacing values in an OFMutableArray.
Definition: OFMutableArray.h:34
An abstract class for storing objects in an array.
Definition: OFArray.h:107
OFArraySortOptions
Options for sorting an array.
Definition: OFArray.h:56
void makeImmutable()
Converts the mutable array to an immutable array.
Definition: OFMutableArray.m:420
void removeAllObjects()
Removes all objects.
Definition: OFMutableArray.m:316
void removeLastObject()
Removes the last object.
Definition: OFMutableArray.m:306
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:47
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
instancetype init()
Initializes an OFMutableArray with no objects.
Definition: OFMutableArray.m:164
OFComparisonResult(^ OFComparator)(id left, id right)
A comparator to compare two objects.
Definition: OFObject.h:86
A range.
Definition: OFObject.h:110
OFComparisonResult(* OFCompareFunction)(id left, id right, void *context)
A function to compare two objects.
Definition: OFObject.h:75