org.mortbay.util
public class LazyList extends Object
Object lazylist =null; while(loopCondition) { Object item = getItem(); if (item.isToBeAdded()) lazylist = LazyList.add(lazylist,item); } return LazyList.getList(lazylist);An ArrayList of default size is used as the initial LazyList.
Version: $Revision: 1.18 $
See Also: java.util.List
Method Summary | |
---|---|
static Object | add(Object list, Object item) Add an item to a LazyList |
static Object | add(Object list, int index, Object item) Add an item to a LazyList |
protected Object | add(Object list, Collection collection) Add the contents of a Collection to a LazyList |
static Object | addCollection(Object list, Collection collection) Add the contents of a Collection to a LazyList |
static Object | clone(Object list) |
static boolean | contains(Object list, Object item) |
static Object | ensureSize(Object list, int initialSize) |
static Object | get(Object list, int i) Get item from the list |
static List | getList(Object list) Get the real List from a LazyList.
|
static List | getList(Object list, boolean nullForEmpty) Get the real List from a LazyList.
|
static Iterator | iterator(Object list) |
static ListIterator | listIterator(Object list) |
static Object | remove(Object list, Object o) |
static Object | remove(Object list, int i) |
static int | size(Object list) The size of a lazy List |
static String | toString(Object list) |
static String[] | toStringArray(Object list) |
Parameters: list The list to add to or null if none yet created. item The item to add.
Returns: The lazylist created or added to.
Parameters: list The list to add to or null if none yet created. index The index to add the item at. item The item to add.
Returns: The lazylist created or added to.
Deprecated: Use addCollection
Add the contents of a Collection to a LazyListParameters: list The list to add to or null if none yet created. collection The Collection whose contents should be added.
Returns: The lazylist created or added to.
Parameters: list The list to add to or null if none yet created. collection The Collection whose contents should be added.
Returns: The lazylist created or added to.
Parameters: list A LazyList returned from LazyList.add(Object) or null i int index
Returns: the item from the list.
Parameters: list A LazyList returned from LazyList.add(Object)
Returns: The List of added items, which may be an EMPTY_LIST or a SingletonList.
Parameters: list A LazyList returned from LazyList.add(Object) or null nullForEmpty If true, null is returned instead of an empty list.
Returns: The List of added items, which may be null, an EMPTY_LIST or a SingletonList.
Parameters: list A LazyList returned from LazyList.add(Object) or null
Returns: the size of the list.