public class

AutoPopulatingList

extends Object
implements Serializable List<E>
java.lang.Object
   ↳ org.springframework.util.AutoPopulatingList<E>

Class Overview

Simple List wrapper class that allows for elements to be automatically populated as they are requested. This is particularly useful for data binding to Lists, allowing for elements to be created and added to the List in a "just in time" fashion.

Note: This class is not thread-safe. To create a thread-safe version, use the synchronizedList(List) utility methods.

Inspired by LazyList from Commons Collections.

Summary

Nested Classes
interface AutoPopulatingList.ElementFactory<E> Factory interface for creating elements for an index-based access data structure such as a java.util.List. 
class AutoPopulatingList.ElementInstantiationException Exception to be thrown from ElementFactory. 
Public Constructors
AutoPopulatingList(Class<? extends E> elementClass)
Creates a new AutoPopulatingList that is backed by a standard ArrayList and adds new instances of the supplied element Class to the backing List on demand.
AutoPopulatingList(List<E> backingList, Class<? extends E> elementClass)
Creates a new AutoPopulatingList that is backed by the supplied List and adds new instances of the supplied element Class to the backing List on demand.
AutoPopulatingList(ElementFactory<E> elementFactory)
Creates a new AutoPopulatingList that is backed by a standard ArrayList and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.
AutoPopulatingList(List<E> backingList, ElementFactory<E> elementFactory)
Creates a new AutoPopulatingList that is backed by the supplied List and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.
Public Methods
boolean add(E o)
void add(int index, E element)
boolean addAll(Collection<? extends E> c)
boolean addAll(int index, Collection<? extends E> c)
void clear()
boolean contains(Object o)
boolean containsAll(Collection c)
boolean equals(Object other)
E get(int index)
Get the element at the supplied index, creating it if there is no element at that index.
int hashCode()
int indexOf(Object o)
boolean isEmpty()
Iterator<E> iterator()
int lastIndexOf(Object o)
ListIterator<E> listIterator(int index)
ListIterator<E> listIterator()
E remove(int index)
boolean remove(Object o)
boolean removeAll(Collection<?> c)
boolean retainAll(Collection<?> c)
E set(int index, E element)
int size()
List<E> subList(int fromIndex, int toIndex)
<T> T[] toArray(T[] a)
Object[] toArray()
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.List

Public Constructors

public AutoPopulatingList (Class<? extends E> elementClass)

Also: SpringCore

Creates a new AutoPopulatingList that is backed by a standard ArrayList and adds new instances of the supplied element Class to the backing List on demand.

public AutoPopulatingList (List<E> backingList, Class<? extends E> elementClass)

Also: SpringCore

Creates a new AutoPopulatingList that is backed by the supplied List and adds new instances of the supplied element Class to the backing List on demand.

public AutoPopulatingList (ElementFactory<E> elementFactory)

Also: SpringCore

Creates a new AutoPopulatingList that is backed by a standard ArrayList and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.

public AutoPopulatingList (List<E> backingList, ElementFactory<E> elementFactory)

Also: SpringCore

Creates a new AutoPopulatingList that is backed by the supplied List and creates new elements on demand using the supplied AutoPopulatingList.ElementFactory.

Public Methods

public boolean add (E o)

Also: SpringCore

public void add (int index, E element)

Also: SpringCore

public boolean addAll (Collection<? extends E> c)

Also: SpringCore

public boolean addAll (int index, Collection<? extends E> c)

Also: SpringCore

public void clear ()

Also: SpringCore

public boolean contains (Object o)

Also: SpringCore

public boolean containsAll (Collection c)

Also: SpringCore

public boolean equals (Object other)

public E get (int index)

Also: SpringCore

Get the element at the supplied index, creating it if there is no element at that index.

public int hashCode ()

public int indexOf (Object o)

Also: SpringCore

public boolean isEmpty ()

Also: SpringCore

public Iterator<E> iterator ()

Also: SpringCore

public int lastIndexOf (Object o)

Also: SpringCore

public ListIterator<E> listIterator (int index)

Also: SpringCore

public ListIterator<E> listIterator ()

Also: SpringCore

public E remove (int index)

Also: SpringCore

public boolean remove (Object o)

Also: SpringCore

public boolean removeAll (Collection<?> c)

Also: SpringCore

public boolean retainAll (Collection<?> c)

Also: SpringCore

public E set (int index, E element)

Also: SpringCore

public int size ()

Also: SpringCore

public List<E> subList (int fromIndex, int toIndex)

Also: SpringCore

public T[] toArray (T[] a)

Also: SpringCore

public Object[] toArray ()

Also: SpringCore