WebObjects Admiration ERXArrayUtilities
23 August 14:17
ERXArrayUtilities provides accessibility methods and accoutrement for manipulating NSArrays. Some of the methods are cocky explanatory. For a abounding account amuse see the api (http://www.mdimension.com/~wonder/api/er/extensions/ERXArrayUtilities.html).
WebObjects provides @sum, @avg, etc arrangement operators. ERXArrayUtilities adds absolutely a few more:
SortOperator: Ascertain an NSArray.Operator for the key sort.
This allows for key amount paths like:
myArray.valueForKey(@sort.firstName);
myArray.valueForKey(@sort.lastName,firstName);
Which in the first case would acknowledgment myArray sorted ascendance by first name and the additional case
by lastName and then by firstName.
Other array operators registered are: @sortAsc, @sortDesc, @sortInsensitiveAsc, @sortInsensitiveDesc
FetchSpecOperator: Ascertain an NSArray.Operator for the key fetchSpec.
This allows for key amount paths like:
myArray.valueForKey(@fetchSpec.fetchUsers);
Which in this case would acknowledgment myArray filtered and sorted by the
EOFetchSpecification called fetchUsers which haveto be a model-based fetchspec in the
first altar entity.
FlattenOperator: Ascertain an NSArray.Operator for the key flatten.
This allows for key amount paths like:
myArray.valueForKey(@flatten);
Which in this case would acknowledgment myArray bedfast if myArray is an NSArray of NSArrays (of NSArrays etc).
IsEmptyOperator: Ascertain an NSArray.Operator for the key isEmpty.
This allows for key amount paths like:
myArray.valueForKey(@isEmpty);
SubarrayWithRangeOperator: Ascertain an NSArray.Operator for the key subarrayWithRange.
This allows for key amount paths like:
myArray.valueForKey(@subarrayWithRange.3-20);
UniqueOperator: Ascertain an NSArray.Operator for the key unique.
This allows for key amount paths like:
myArray.valueForKeyPath(@unique.someOtherPath);
Which in this case would acknowledgment alone those altar which are different in myArray.
RemoveNullValuesOperator: Ascertain an NSArray.Operator for the key removeNullValues.
This allows for key amount paths like:
myArray.valueForKeyPath(@removeNullValues.someOtherPath);
Which in this case would acknowledgment myArray after the occurrences of NSKeyValueCoding.Null.
ObjectAtIndexOperator: Ascertain an NSArray.Operator for the key objectAtIndex.
This allows for key amount paths like:
myArray.valueForKey(@objectAtIndex.3.firstName);
AvgNonNullOperator: Ascertain an NSArray.Operator for the key avgNonNull.
This allows for key amount paths like:
myArray.valueForKey(@avgNonNull.revenue);
which will sum up all ethics and bisect by the amount of nun-null entries.
ReverseOperator: Ascertain an NSArray.Operator for the key reverse.
This allows for key amount paths like:
myArray.valueForKey(@reverse.someMorePath);
which acknowledgment a antipodal aftereffect as to you would commonly get.
MedianOperator: Ascertain an NSArray.Operator for the key median.
This allows for key amount paths like:
myArray.valueForKey(@median.someMorePath);
which acknowledgment the average of the arrangement elements at the accustomed key path.
The average is the amount for which bisected of the elements are aloft and bisected the elements are below.
As such, an arrangement array is bare and this ability be actual cher depending of the admeasurement of the array.
ERXArrayUtilities provides accessibility methods and accoutrement for manipulating NSArrays. Some of the methods are cocky explanatory. For a abounding account amuse see the api (http://www.mdimension.com/~wonder/api/er/extensions/ERXArrayUtilities.html).
WebObjects provides @sum, @avg, etc arrangement operators. ERXArrayUtilities adds absolutely a few more:
SortOperator: Ascertain an NSArray.Operator for the key sort.
This allows for key amount paths like:
myArray.valueForKey(@sort.firstName);
myArray.valueForKey(@sort.lastName,firstName);
Which in the first case would acknowledgment myArray sorted ascendance by first name and the additional case
by lastName and then by firstName.
Other array operators registered are: @sortAsc, @sortDesc, @sortInsensitiveAsc, @sortInsensitiveDesc
FetchSpecOperator: Ascertain an NSArray.Operator for the key fetchSpec.
This allows for key amount paths like:
myArray.valueForKey(@fetchSpec.fetchUsers);
Which in this case would acknowledgment myArray filtered and sorted by the
EOFetchSpecification called fetchUsers which haveto be a model-based fetchspec in the
first altar entity.
FlattenOperator: Ascertain an NSArray.Operator for the key flatten.
This allows for key amount paths like:
myArray.valueForKey(@flatten);
Which in this case would acknowledgment myArray bedfast if myArray is an NSArray of NSArrays (of NSArrays etc).
IsEmptyOperator: Ascertain an NSArray.Operator for the key isEmpty.
This allows for key amount paths like:
myArray.valueForKey(@isEmpty);
SubarrayWithRangeOperator: Ascertain an NSArray.Operator for the key subarrayWithRange.
This allows for key amount paths like:
myArray.valueForKey(@subarrayWithRange.3-20);
UniqueOperator: Ascertain an NSArray.Operator for the key unique.
This allows for key amount paths like:
myArray.valueForKeyPath(@unique.someOtherPath);
Which in this case would acknowledgment alone those altar which are different in myArray.
RemoveNullValuesOperator: Ascertain an NSArray.Operator for the key removeNullValues.
This allows for key amount paths like:
myArray.valueForKeyPath(@removeNullValues.someOtherPath);
Which in this case would acknowledgment myArray after the occurrences of NSKeyValueCoding.Null.
ObjectAtIndexOperator: Ascertain an NSArray.Operator for the key objectAtIndex.
This allows for key amount paths like:
myArray.valueForKey(@objectAtIndex.3.firstName);
AvgNonNullOperator: Ascertain an NSArray.Operator for the key avgNonNull.
This allows for key amount paths like:
myArray.valueForKey(@avgNonNull.revenue);
which will sum up all ethics and bisect by the amount of nun-null entries.
ReverseOperator: Ascertain an NSArray.Operator for the key reverse.
This allows for key amount paths like:
myArray.valueForKey(@reverse.someMorePath);
which acknowledgment a antipodal aftereffect as to you would commonly get.
MedianOperator: Ascertain an NSArray.Operator for the key median.
This allows for key amount paths like:
myArray.valueForKey(@median.someMorePath);
which acknowledgment the average of the arrangement elements at the accustomed key path.
The average is the amount for which bisected of the elements are aloft and bisected the elements are below.
As such, an arrangement array is bare and this ability be actual cher depending of the admeasurement of the array.
|
Tags: array, allows, elements, value myarray, value, nsarray, operator, paths, allows, define, valueforkey, return, erxarrayutilities, array, firstname, elements, median, webobjects, nsarrays, , nsarray operator, paths like, key value, value paths, operator for, allows for, myarray valueforkey, case would, return myarray, value paths like, paths like myarray, key value paths, case would return, somemorepath which return, myarray valueforkey @sort, webobjects wonder erxarrayutilities, |
Also see ...
PermalinkArticle In : Computers & Technology - Websites Help