|
Objectively
Ultra-lightweight object oriented framework for GNU C.
|
#include <Array.h>
Properties | |
| size_t | count |
| The count of elements. | |
| Object | object |
| The superclass. | |
Properties inherited from Object | |
| Class * | clazz |
| Every instance of Object begins with a pointer to its Class. | |
| unsigned int | magic |
| A header to allow introspection of Object types. | |
Methods | |
| Class * | _Array (void) |
| The Array archetype. | |
| void | addObject (Array *self, const ident obj) |
| Adds the specified Object to this Array. | |
| void | addObjects (Array *self, const ident obj,...) |
| Adds the specified objects to this Array. | |
| void | addObjectsFromArray (Array *self, const Array *array) |
Adds the Objects contained in array to this Array. | |
| Array * | array (void) |
| Returns a new Array. | |
| Array * | arrayWithArray (const Array *array) |
Returns a new Array containing the contents of array. | |
| Array * | arrayWithCapacity (size_t capacity) |
Returns a new Array with the given capacity. | |
| Array * | arrayWithObjects (ident obj,...) |
| Returns a new Array containing the given Objects. | |
| Array * | arrayWithVaList (va_list args) |
Returns a new Array containing the Objects in the given va_list. | |
| String * | componentsJoinedByCharacters (const Array *self, const char *chars) |
Returns the components of this Array joined by chars. | |
| String * | componentsJoinedByString (const Array *self, const String *string) |
| Returns the components of this Array joined by the specified String. | |
| bool | containsObject (const Array *self, const ident obj) |
| void | enumerate (const Array *self, ArrayEnumerator enumerator, ident data) |
| Enumerate the elements of this Array with the given function. | |
| void | filter (Array *self, Predicate predicate, ident data) |
Filters this Array in place using predicate. | |
| Array * | filteredArray (const Array *self, Predicate predicate, ident data) |
Creates a new Array with elements that pass predicate. | |
| ident | find (const Array *self, Predicate predicate, ident data) |
| ident | firstObject (const Array *self) |
| ssize_t | indexOfObject (const Array *self, const ident obj) |
| Array * | init (Array *self) |
| Initializes this Array. | |
| Array * | initWithArray (Array *self, const Array *array) |
Initializes this Array to contain the Objects in array. | |
| Array * | initWithCapacity (Array *self, size_t capacity) |
| Initializes this Array with the specified capacity. | |
| Array * | initWithObjects (Array *self,...) |
Initializes this Array to contain the Objects in the NULL-terminated arguments list. | |
| Array * | initWithVaList (Array *self, va_list args) |
Initializes this Array to contain the Objects in the NULL-terminated va_list. | |
| void | insertObjectAtIndex (Array *self, ident obj, size_t index) |
| Inserts the Object at the specified index. | |
| ident | lastObject (const Array *self) |
| void | map (Array *self, Functor functor, ident data) |
Transforms the elements in this Array in place using functor. | |
| Array * | mappedArray (const Array *self, Functor functor, ident data) |
Transforms the elements in this Array by functor. | |
| ident | objectAtIndex (const Array *self, size_t index) |
| ident | reduce (const Array *self, Reducer reducer, ident accumulator, ident data) |
| void | removeAllObjects (Array *self) |
| Removes all Objects from this Array. | |
| void | removeAllObjectsWithEnumerator (Array *self, ArrayEnumerator enumerator, ident data) |
Removes all Objects from this Array, invoking enumerator for each Object. | |
| void | removeLastObject (Array *self) |
| Removes the last Object from this Array. | |
| void | removeObject (Array *self, const ident obj) |
| Removes the specified Object from this Array. | |
| void | removeObjectAtIndex (Array *self, size_t index) |
| Removes the Object at the specified index. | |
| void | setObjectAtIndex (Array *self, const ident obj, size_t index) |
| Replaces the Object at the specified index. | |
| void | sort (Array *self, Comparator comparator) |
Sorts this Array in place using comparator. | |
| Array * | sortedArray (const Array *self, Comparator comparator) |
Methods inherited from Object | |
| Class * | _Object (void) |
| The Object archetype. | |
| Object * | copy (const Object *self) |
| Creates a shallow copy of this Object. | |
| void | dealloc (Object *self) |
| Frees all resources held by this Object. | |
| String * | description (const Object *self) |
| int | hash (const Object *self) |
| Object * | init (Object *self) |
| Initializes this Object. | |
| bool | isEqual (const Object *self, const Object *other) |
| Tests equality of the other Object. | |
| bool | isKindOfClass (const Object *self, const Class *clazz) |
| Tests for Class hierarchy membership. | |
Protected Attributes | |
| ArrayInterface * | interface |
| The interface. | |
Protected Attributes inherited from Object | |
| ObjectInterface * | interface |
| The interface. | |
| Class * _Array | ( | void | ) |
The Array archetype.
Definition at line 760 of file Array.c.
Adds the specified Object to this Array.
Definition at line 181 of file Array.c.
Adds the specified objects to this Array.
| self | The Array. |
| obj | The NULL-terminated list of objects. |
Definition at line 203 of file Array.c.
| Array * array | ( | void | ) |
Returns a new Array containing the contents of array.
| array | An Array. |
NULL on error. Definition at line 243 of file Array.c.
| Array * arrayWithCapacity | ( | size_t | capacity | ) |
Returns a new Array with the given capacity.
| capacity | The desired initial capacity. |
NULL on error. Definition at line 252 of file Array.c.
Returns a new Array containing the given Objects.
| obj | The first in a NULL-terminated list of Objects. |
NULL on error. | Array * arrayWithVaList | ( | va_list | args | ) |
Returns a new Array containing the Objects in the given va_list.
| args | The NULL-terminated va_list of Objects. |
NULL on error. Definition at line 286 of file Array.c.
Returns the components of this Array joined by chars.
| self | The Array. |
| chars | The joining characters. |
Definition at line 295 of file Array.c.
Returns the components of this Array joined by the specified String.
Definition at line 318 of file Array.c.
| void enumerate | ( | const Array * | self, |
| ArrayEnumerator | enumerator, | ||
| ident | data | ||
| ) |
Filters this Array in place using predicate.
| self | The Array. |
| predicate | A Predicate. |
| data | User data. |
Definition at line 347 of file Array.c.
Creates a new Array with elements that pass predicate.
| self | The Array. |
| predicate | The predicate function. |
| data | User data. |
Definition at line 362 of file Array.c.
-1 if not found. Definition at line 403 of file Array.c.
Initializes this Array to contain the Objects in the NULL-terminated arguments list.
| self | The Array. |
NULL on error. Definition at line 473 of file Array.c.
Initializes this Array to contain the Objects in the NULL-terminated va_list.
| self | The Array. |
| args | The NULL-terminated va_list of Objects. |
NULL on error. Definition at line 488 of file Array.c.
Inserts the Object at the specified index.
| self | The Array. |
| reducer | The Reducer. |
| accumulator | The initial accumulator value. |
| data | User data. |
| void removeAllObjects | ( | Array * | self | ) |
Removes all Objects from this Array.
| self | The Array. |
Definition at line 604 of file Array.c.
| void removeAllObjectsWithEnumerator | ( | Array * | self, |
| ArrayEnumerator | enumerator, | ||
| ident | data | ||
| ) |
| void removeLastObject | ( | Array * | self | ) |
Removes the specified Object from this Array.
| void sort | ( | Array * | self, |
| Comparator | comparator | ||
| ) |
Sorts this Array in place using comparator.
| self | The Array. |
| comparator | The Comparator. |
Definition at line 686 of file Array.c.
| Array * sortedArray | ( | const Array * | self, |
| Comparator | comparator | ||
| ) |
| self | The Array. |
| comparator | The Comparator |
Definition at line 694 of file Array.c.