picofuse-objc

NXArray.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include "NXCollection.h"
7 #include <stdarg.h>
8 #include <stddef.h>
9 
26 @interface NXArray : NXObject <NXCollection> {
27 @private
28  id *_objects;
29  size_t _count;
30  size_t _capacity;
31  unsigned long _mutations;
32  uintptr_t _changing;
33 }
34 
38 + (id)array;
39 
44 + (id)arrayWithCapacity:(size_t)capacity;
45 
50 + (id)arrayWithObjects:(id)firstObject, ...;
51 
55 - (id)initWithCapacity:(size_t)capacity;
56 
60 - (id)initWithObjects:(id)firstObject, ...;
61 
65 - (size_t)count;
66 
70 - (size_t)capacity;
71 
75 - (id)objectAtIndex:(size_t)index;
76 
80 - (id)firstObject;
81 
85 - (id)lastObject;
86 
90 - (size_t)indexOfObject:(id)object;
91 
95 - (BOOL)containsObject:(id)object;
96 
101 - (BOOL)appendObject:(id)object;
102 
110 - (BOOL)insertObject:(id)object atIndex:(size_t)index;
111 
116 - (BOOL)replaceObjectAtIndex:(size_t)index withObject:(id)object;
117 
122 - (BOOL)removeObjectAtIndex:(size_t)index;
123 
128 - (size_t)removeObject:(id)object;
129 
135 
139 - (void)removeAllObjects;
140 
145 - (BOOL)isEqual:(id)anObject;
146 
150 - (uintptr_t)hash;
151 
156 - (id)copy;
157 
161 - (NXString *)description;
162 
169 - (NXArray *)subarrayFromIndex:(size_t)index count:(size_t)count;
170 
178 - (NXString *)componentsJoinedByString:(NXString *)separator;
179 
189 - (BOOL)sortUsingSelector:(SEL)comparator;
190 
191 @end
NXString * description()
Returns the descriptions of the objects, such as "[1, 2, three]".
id copy()
Returns a new array of the same objects, which are retained by it too, or nil if there isn&#39;t enough m...
id lastObject()
Returns the last object, or nil if the array is empty.
Defines the NXCollection protocol, for objects which hold other objects.
id firstObject()
Returns the first object, or nil if the array is empty.
void removeAllObjects()
Removes every object, but keeps the room for them.
size_t count()
Returns the number of objects.
BOOL removeLastObject()
Removes the last object.
id array()
Returns an empty array.
bool BOOL
A Boolean value.
Definition: runtime.h:60
size_t capacity()
Returns the number of objects there&#39;s room for, before more memory is needed.
A string of UTF-8 text.
Definition: NXString.h:53
An ordered list of objects, which can be changed.
Definition: NXArray.h:26
The base class for objects in the Foundation framework.
Definition: NXObject.h:28
Objects which hold other objects, such as arrays, which can be gone through with a for...
Definition: NXCollection.h:19
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
uintptr_t hash()
Returns a hash of the objects, in order, which is the same for equal arrays.