public static class ERXArrayUtilities.SubarrayWithRangeOperator extends Object
NSArray.Operator
for the key subarrayWithRange.
This allows for key value paths like:
myArray.valueForKeyPath("@subarrayWithRange.20-3.someOtherPath");
Which in this case would return the three objects from myArray
, starting
at the index of 20, before continuing to process someOtherPath
.
Note that the syntax for the range argument is not startIndex-endIndex. The API matches that of NSRange. You must provide a start index and an array length.
BaseOperator
Constructor and Description |
---|
SubarrayWithRangeOperator() |
Modifier and Type | Method and Description |
---|---|
Object |
compute(NSArray array,
String keypath) |
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 truncatekeypath
- the key path to follow after truncationpublic 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.