FoundationExtension
FoundationExtension is common Foundation/UIKit/Cocoa shortcuts and snippets collection.
|
See Map/Filter/Reduce for concept of functional tools. More...
#import <NSAFunctional.h>
Instance Methods | |
(void) | - applyProcedure: |
Apply procedure to objects. More... | |
(NSArray *) | - arrayByMappingOperator: |
Returns an array of the result objects of mapping the given mappter to objects. More... | |
(NSArray *) | - arrayByMapFilteringOperator: |
Returns an array of the result objects of mapping the given mappter to objects which is not nil. More... | |
(NSArray *) | - arrayByFilteringOperator: |
Filters objects and returns result as array. More... | |
(id) | - reduce: |
Reduces objects and returns the result. More... | |
(id) | - reduce:initialObject: |
Reduces objects and returns the result. More... | |
(NSSet *) | - setByMappingOperator: |
Maps mapper to objects and returns the result as set. More... | |
(NSSet *) | - setByMapFilteringOperator: |
Maps mapper to objects and filters nil result and returns the result as set. More... | |
(NSSet *) | - setByFilteringOperator: |
Filters objects and returns result as set. More... | |
(id) | - firstObjectByFilteringOperator: |
Filters objects and returns the first object of result. More... | |
See Map/Filter/Reduce for concept of functional tools.
Set is treated as variation of array.
- (void) applyProcedure: | (NSAObjectProcedure) | procedure |
- (NSArray *) arrayByFilteringOperator: | (NSAObjectPicker) | filter |
- (NSArray *) arrayByMapFilteringOperator: | (NSAObjectUnaryOperator) | mapper |
Returns an array of the result objects of mapping the given mappter to objects which is not nil.
Shallow wrapper of NSAMapFilter
- (NSArray *) arrayByMappingOperator: | (NSAObjectUnaryOperator) | mapper |
- (id) firstObjectByFilteringOperator: | (NSAObjectPicker) | filter |
Filters objects and returns the first object of result.
Shallow wrapper of NSAFilterWithIndex
- (id) reduce: | (NSAObjectBinaryOperator) | reduce |
- (id) reduce: | (NSAObjectBinaryOperator) | reduce | |
initialObject: | (id) | initialObject | |
Reduces objects and returns the result.
Shallow wrapper of NSAReduceWithInitialObject
- (NSSet *) setByFilteringOperator: | (NSAObjectPicker) | filter |
- (NSSet *) setByMapFilteringOperator: | (NSAObjectUnaryOperator) | mapper |
Maps mapper to objects and filters nil result and returns the result as set.
Shallow wrapper of NSAMapFilter
- (NSSet *) setByMappingOperator: | (NSAObjectUnaryOperator) | mapper |