Project Wonder 5.0.0.8795

er.extensions.foundation
Class ERXArrayUtilities.SubarrayWithRangeOperator

java.lang.Object
  extended by er.extensions.foundation.ERXArrayUtilities.SubarrayWithRangeOperator
All Implemented Interfaces:
NSArray.Operator
Enclosing class:
ERXArrayUtilities

public static class ERXArrayUtilities.SubarrayWithRangeOperator
extends Object

Define an NSArray.Operator for the key subarrayWithRange.

This allows for key value paths like:

myArray.valueForKeyPath("@subarrayWithRange.20-3.name");

Note that the syntax is slightly misleading, implying that you provide a start and end index. In fact, the API matches NSRange and you must provide a start index and a length. Unfortunately changing this either syntax or implementation will break backwards compatibility (and subtly), so we have to suck it up for now.


Constructor Summary
ERXArrayUtilities.SubarrayWithRangeOperator()
          public empty constructor
 
Method Summary
 Object compute(NSArray array, String keypath)
           
 NSArray contents(NSArray array, String keypath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXArrayUtilities.SubarrayWithRangeOperator

public ERXArrayUtilities.SubarrayWithRangeOperator()
public empty constructor

Method Detail

compute

public Object compute(NSArray array,
                      String keypath)
Parameters:
array - array to be checked.
keypath - name of fetch specification.
Returns:
Boolean.TRUE if array is empty, Boolean.FALSE otherwise.

contents

public NSArray contents(NSArray array,
                        String keypath)

Last updated: Fri, Jan 9, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.