Public Member Functions | Static Public Member Functions | Protected Attributes

OFArray Class Reference

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

#import <OFArray.h>

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

List of all members.

Public Member Functions

(id) - initWithObject:
(id) - initWithObjects:
(id) - initWithObject:argList:
(id) - initWithCArray:
(id) - initWithCArray:length:
(id *) - cArray
(id) - objectAtIndex:
(size_t) - indexOfObject:
(size_t) - indexOfObjectIdenticalTo:
(id) - firstObject
(id) - lastObject
(OFArray *) - objectsFromIndex:toIndex:
(OFArray *) - objectsInRange:
(OFString *) - componentsJoinedByString:
(void) - makeObjectsPerformSelector:
(void) - makeObjectsPerformSelector:withObject:
(void) - enumerateObjectsUsingBlock:
(OFArray *) - mappedArrayUsingBlock:
(OFArray *) - filteredArrayUsingBlock:

Static Public Member Functions

(id) + array
(id) + arrayWithObject:
(id) + arrayWithObjects:
(id) + arrayWithCArray:
(id) + arrayWithCArray:length:

Protected Attributes

OFDataArrayarray

Detailed Description

A class for storing objects in an array.


Member Function Documentation

+ (id) array  
Returns:
A new autoreleased OFArray
+ (id) arrayWithCArray: (id*)  objs  

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

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

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

Parameters:
objs A C array of objects
len The length of the C array
Returns:
A new autoreleased OFArray
+ (id) arrayWithObject: (id)  obj  

Creates a new OFArray with the specified object.

Parameters:
obj An object
Returns:
A new autoreleased OFArray
+ (id) arrayWithObjects: (id)  first
,   ... 

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

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

Creates a string by joining all objects of the array.

Parameters:
separator The string with which the objects should be joined
Returns:
A string containing all objects joined by the separator
- (void) enumerateObjectsUsingBlock: (of_array_enumeration_block_t)  block  

Executes a block for each object.

Parameters:
block The block to execute for each object
- (OFArray *) filteredArrayUsingBlock: (of_array_filter_block_t)  block  

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

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

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) indexOfObject: (id)  obj  

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

Parameters:
obj The 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) indexOfObjectIdenticalTo: (id)  obj  

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:
obj The 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) initWithCArray: (id*)  objs  

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

Parameters:
objs A C array of objects, terminated with nil
Returns:
An initialized OFArray
- (id) initWithCArray: (id*)  objs
length: (size_t)  len 

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

Parameters:
objs A C array of objects
len The length of the C array
Returns:
An initialized OFArray
- (id) initWithObject: (id)  obj  

Initializes an OFArray with the specified object.

Parameters:
obj An object
Returns:
An initialized OFArray
- (id) initWithObject: (id)  first
argList: (va_list)  args 

Initializes an OFArray with the specified object and a va_list.

Parameters:
first The first object
args A va_list
Returns:
An initialized OFArray
- (id) initWithObjects: (id)  first
,   ... 

Initializes an OFArray with the specified objects.

Parameters:
first The first object
Returns:
An initialized OFArray
- (id) lastObject  

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) makeObjectsPerformSelector: (SEL)  selector  

Performs the specified selector on all objects in the array.

Parameters:
selector The selector to perform on all objects in the array
- (void) makeObjectsPerformSelector: (SEL)  selector
withObject: (id)  obj 

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

Parameters:
selector The selector to perform on all objects in the array
obj The object to perform the selector with on all objects in the array
- (OFArray *) mappedArrayUsingBlock: (of_array_map_block_t)  block  

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

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

Returns a specific object of the array.

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

Parameters:
index The number of the object to return
Returns:
The specified object of the OFArray
- (OFArray *) objectsFromIndex: (size_t)  start
toIndex: (size_t)  end 

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

Parameters:
start The index where the subarray starts
end The index where the subarray ends. This points BEHIND the last object!
Returns:
The subarray as a new autoreleased OFArray
- (OFArray *) objectsInRange: (of_range_t range  

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

Parameters:
range The 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