Class ReadableListUtil


public class ReadableListUtil
extends Object

Utility methods for retrieving data from a readable list. This class assumes that (a) the readable list passed in properly implements ReadableList.size() and ReadableList.getAt(int), and (b) that the invoker of this class's methods does any locking or synchronizing required.

Constructor Summary
          Constructs a new ReadableListUtil instance.
Method Summary
static int getAt(int start, int count, Object[] dest, int destIndex, ReadableList list)
          Retrieves range of elements starting at provided index.
static int getIndex(Object element, ReadableList list)
          Retrieves index by element.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ReadableListUtil()
Constructs a new ReadableListUtil instance.

Method Detail


public static int getAt(int start,
                        int count,
                        Object[] dest,
                        int destIndex,
                        ReadableList list)
Retrieves range of elements starting at provided index.

start - Index of first element to retrieve.
count - Number of elements to retrieve.
dest - Object array to contain returned elements; this array must have enough space to hold the number of elements you expect to receive.
destIndex - Index within destination array to contain the first element retrieved (the destination array must therefore be at least destIndex + count elements long).
list - Readable list from which to fetch the elements.
The number of elements actually retrieved.
ArrayIndexOutOfBoundsException - If start parameter is not valid.
JDE 4.0.2


public static int getIndex(Object element,
                           ReadableList list)
Retrieves index by element.

Note: This operation may be linear with respect to the number of elements in the list.

element - Element to locate.
list - Readable list in which to search for the element.
Index of provided element, or -1 if the element isn't contained in this collection.
JDE 4.0.2

Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.