public static class ERXArrayUtilities.FlattenOperator extends Object
NSArray.Operator
for the key flatten.
This allows for key value paths like:
myArray.valueForKey("@flatten.someOtherPath");
Which in this case would return myArray flattened if myArray is an NSArray
of NSArrays (of NSArrays etc) before continuing to process someOtherPath.BaseOperator
Constructor and Description |
---|
FlattenOperator() |
Modifier and Type | Method and Description |
---|---|
Object |
compute(NSArray array,
String keypath)
Flattens the given array.
|
Object |
contents(NSArray<?> array,
String keypath)
Rather than iterating through the array argument calling
valueForKeyPath
on each array object, this method operates by calling
valueForKeyPath
on the array argument instead. |
public Object compute(NSArray array, String keypath)
array
- array to be flattened.keypath
- additional keypathpublic Object contents(NSArray<?> array, String keypath)
valueForKeyPath
on each array object, this method operates by calling
valueForKeyPath
on the array argument instead. This method is used by Wonder operators to chain
multiple array operators in a single key path.array
- the array value for the operatorkeypath
- the keypath to call on the array argumentCopyright © 2002 – 2020 Project Wonder.