ObjFW
Public Member Functions | Static Public Member Functions | Protected Attributes
OFArray Class Reference

A class for storing objects in an array. More...

#include <OFArray.h>

Inheritance diagram for OFArray:
OFObject <OFCopying> <OFMutableCopying> <OFCollection> <OFFastEnumeration> <OFObject> <OFObject> OFMutableArray

List of all members.

Public Member Functions

id initWithObject: (id obj)
id initWithObjects: (id first,[,]...)
id initWithObject:argList: (id first,[argList] va_list args)
id initWithCArray: (id *objs)
id initWithCArray:length: (id *objs,[length] size_t len)
id * cArray ()
id objectAtIndex: (size_t index)
size_t indexOfObject: (id obj)
size_t indexOfObjectIdenticalTo: (id obj)
id firstObject ()
id lastObject ()
OFArrayobjectsFromIndex:toIndex: (size_t start,[toIndex] size_t end)
OFArrayobjectsInRange: (of_range_t range)
OFStringcomponentsJoinedByString: (OFString *separator)
void makeObjectsPerformSelector: (SEL selector)
void makeObjectsPerformSelector:withObject: (SEL selector,[withObject] id obj)
void enumerateObjectsUsingBlock: (of_array_enumeration_block_t block)
OFArraymappedArrayUsingBlock: (of_array_map_block_t block)
OFArrayfilteredArrayUsingBlock: (of_array_filter_block_t block)

Static Public Member Functions

id array ()
id arrayWithObject: (id obj)
id arrayWithObjects: (id first,[,]...)
id arrayWithCArray: (id *objs)
id arrayWithCArray:length: (id *objs,[length] size_t len)

Protected Attributes

OFDataArrayarray

Detailed Description

A class for storing objects in an array.


Member Function Documentation

id OFArray::array ( ) [static, virtual]
Returns:
A new autoreleased OFArray
id OFArray::arrayWithCArray: ( id*  objs) [static, virtual]

Creates a new OFArray with the objects from the specified C array.

Parameters:
objsA C array of objects, terminated with nil
Returns:
A new autoreleased OFArray
id OFArray::arrayWithCArray:length: ( id*  objs,
[length] size_t  len 
) [static, virtual]

Creates a new OFArray with the objects from the specified C array of the specified length.

Parameters:
objsA C array of objects
lenThe length of the C array
Returns:
A new autoreleased OFArray
id OFArray::arrayWithObject: ( id  obj) [static, virtual]

Creates a new OFArray with the specified object.

Parameters:
objAn object
Returns:
A new autoreleased OFArray
id OFArray::arrayWithObjects: ( id  first,
[,]   ... 
) [static, virtual]

Creates a new OFArray with the specified objects, terminated by nil.

Parameters:
firstThe first object in the array
Returns:
A new autoreleased OFArray
id * OFArray::cArray ( ) [virtual]
Returns:
The objects of the array as a C array
OFString * OFArray::componentsJoinedByString: ( OFString separator) [virtual]

Creates a string by joining all objects of the array.

Parameters:
separatorThe string with which the objects should be joined
Returns:
A string containing all objects joined by the separator
void OFArray::enumerateObjectsUsingBlock: ( of_array_enumeration_block_t  block) [virtual]

Executes a block for each object.

Parameters:
blockThe block to execute for each object
OFArray * OFArray::filteredArrayUsingBlock: ( of_array_filter_block_t  block) [virtual]

Returns a new array, only containing the objects for which the block returns YES.

Parameters:
blockA block which determines if the object should be in the new array
Returns:
A new, autoreleased OFArray
id OFArray::firstObject ( ) [virtual]

Returns the first object of the array or nil.

The returned object is not retained and autoreleased for performance reasons!

Returns:
The first object of the array or nil
size_t OFArray::indexOfObject: ( id  obj) [virtual]

Returns the index of the first object that is equivalent to the specified object or OF_INVALID_INDEX if it was not found.

Parameters:
objThe object whose index is returned
Returns:
The index of the first object equivalent to the specified object or OF_INVALID_INDEX if it was not found
size_t OFArray::indexOfObjectIdenticalTo: ( id  obj) [virtual]

Returns the index of the first object that has the same address as the specified object or OF_INVALID_INDEX if it was not found.

Parameters:
objThe object whose index is returned
Returns:
The index of the first object that has the same aaddress as the specified object or OF_INVALID_INDEX if it was not found
id OFArray::initWithCArray: ( id*  objs) [virtual]

Initializes an OFArray with the objects from the specified C array.

Parameters:
objsA C array of objects, terminated with nil
Returns:
An initialized OFArray
id OFArray::initWithCArray:length: ( id*  objs,
[length] size_t  len 
) [virtual]

Initializes an OFArray with the objects from the specified C array of the specified length.

Parameters:
objsA C array of objects
lenThe length of the C array
Returns:
An initialized OFArray
id OFArray::initWithObject: ( id  obj) [virtual]

Initializes an OFArray with the specified object.

Parameters:
objAn object
Returns:
An initialized OFArray
id OFArray::initWithObject:argList: ( id  first,
[argList] va_list  args 
) [virtual]

Initializes an OFArray with the specified object and a va_list.

Parameters:
firstThe first object
argsA va_list
Returns:
An initialized OFArray
id OFArray::initWithObjects: ( id  first,
[,]   ... 
) [virtual]

Initializes an OFArray with the specified objects.

Parameters:
firstThe first object
Returns:
An initialized OFArray
id OFArray::lastObject ( ) [virtual]

Returns the last object of the array or nil.

The returned object is not retained and autoreleased for performance reasons!

Returns:
The last object of the array or nil
void OFArray::makeObjectsPerformSelector: ( SEL  selector) [virtual]

Performs the specified selector on all objects in the array.

Parameters:
selectorThe selector to perform on all objects in the array
void OFArray::makeObjectsPerformSelector:withObject: ( SEL  selector,
[withObject] id  obj 
) [virtual]

Performs the specified selector on all objects in the array with the specified object.

Parameters:
selectorThe selector to perform on all objects in the array
objThe object to perform the selector with on all objects in the array
OFArray * OFArray::mappedArrayUsingBlock: ( of_array_map_block_t  block) [virtual]

Returns a new array, mapping each object using the specified block.

Parameters:
blockA block which maps an object for each object
Returns:
A new, autoreleased OFArray
id OFArray::objectAtIndex: ( size_t  index) [virtual]

Returns a specific object of the array.

The returned object is not retained and autoreleased for performance reasons!

Parameters:
indexThe number of the object to return
Returns:
The specified object of the OFArray
OFArray * OFArray::objectsFromIndex:toIndex: ( size_t  start,
[toIndex] size_t  end 
) [virtual]

Returns the objects from the specified index to the specified index as a new OFArray.

Parameters:
startThe index where the subarray starts
endThe index where the subarray ends. This points BEHIND the last object!
Returns:
The subarray as a new autoreleased OFArray
OFArray * OFArray::objectsInRange: ( of_range_t  range) [virtual]

Returns the objects in the specified range as a new OFArray.

Parameters:
rangeThe range for the subarray
Returns:
The subarray as a new autoreleased OFArray

The documentation for this class was generated from the following files:
 All Classes Functions Variables