Project Wonder 5.0.0.8795

er.extensions.foundation
Class ERXArrayUtilities.LimitOperator

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

public static class ERXArrayUtilities.LimitOperator
extends Object

Define an NSArray.Operator for the key limit, which is similar to subarrayWithRange except that it is always from 0 to the limit value. If the limit specified is larger than the size of the array, the entire array will be returned.
This allows for key value paths like:

myArray.valueForKeyPath("@limit.10.name");


Constructor Summary
ERXArrayUtilities.LimitOperator()
          Constructs a new LimitOperator
 
Method Summary
 Object compute(NSArray array, String keypath)
          Computes the subarray of the given array.
 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.LimitOperator

public ERXArrayUtilities.LimitOperator()
Constructs a new LimitOperator

Method Detail

compute

public Object compute(NSArray array,
                      String keypath)
Computes the subarray of the given array.

Parameters:
array - array to be checked.
keypath - name of fetch specification.
Returns:
the subarray for the given limit

contents

public NSArray contents(NSArray array,
                        String keypath)

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

Copyright © 2002 – 2007 Project Wonder.