Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.xwork2.util
Class XWorkList

    java.lang.Object
      java.util.AbstractCollection<E>
          java.util.AbstractList<E>
              java.util.ArrayList
                  com.opensymphony.xwork2.util.XWorkList

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

    public class XWorkList

extends java.util.ArrayList

A simple list that guarantees that inserting and retrieving objects will always work regardless of the current size of the list. Upon insertion, type conversion is also performed if necessary. Empty beans will be created to fill the gap between the current list size and the requested index using ObjectFactory's `buildBean` method.

Author:
  Patrick Lightbody
See Also:
  Serialized Form

Field Summary

Fields inherited from class java.util.AbstractList
`modCount`

Constructor Summary
`XWorkList(ObjectFactory fac, XWorkConverter conv, java.lang.Class clazz)`
`XWorkList(ObjectFactory fac, XWorkConverter conv, java.lang.Class clazz, int initialCapacity)`

Method Summary
`void` | `add(int index, java.lang.Object element)` Inserts the specified element at the specified position in this list.
`boolean` | `add(java.lang.Object element)` Appends the specified element to the end of this list.
`boolean` | `addAll(java.util.Collection c)` Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator.
`boolean` | `addAll(int index, java.util.Collection c)` Inserts all of the elements in the specified Collection into this list, starting at the specified position.
`boolean` | `contains(java.lang.Object element)`
`java.lang.Object` | `get(int index)` Returns the element at the specified position in this list.
`java.lang.Object` | `set(int index, java.lang.Object element)` Replaces the element at the specified position in this list with the specified element.

Methods inherited from class java.util.ArrayList
`clear, clone, ensureCapacity, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, size, toArray, toArray, trimToSize`

Methods inherited from class java.util.AbstractList
`equals, hashCode, iterator, listIterator, listIterator, subList`

Methods inherited from class java.util.AbstractCollection
`containsAll, removeAll, retainAll, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.List
`containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList`

Constructor Detail

### XWorkList

    public XWorkList(ObjectFactory fac,
                     XWorkConverter conv,
                     java.lang.Class clazz)

### XWorkList

    public XWorkList(ObjectFactory fac,
                     XWorkConverter conv,
                     java.lang.Class clazz,
                     int initialCapacity)

Method Detail

### add

    public void add(int index,
                    java.lang.Object element)

  Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

  This method is guaranteed to work since it will create empty beans to fill the gap between the current list size and the requested index to enable the element to be set. This method also performs any necessary type conversion.

  Specified by:
    `add` in interface `java.util.List`
  Overrides:
    `add` in class `java.util.ArrayList`
  Parameters:
    `index` - index at which the specified element is to be inserted.
    `element` - element to be inserted.

### add

    public boolean add(java.lang.Object element)

  Appends the specified element to the end of this list.

  This method performs any necessary type conversion.

  Specified by:
    `add` in interface `java.util.Collection`
  Specified by:
    `add` in interface `java.util.List`
  Overrides:
    `add` in class `java.util.ArrayList`
  Parameters:
    `element` - element to be appended to this list.
  Returns:
    `true` (as per the general contract of Collection.add).

### addAll

    public boolean addAll(java.util.Collection c)

  Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator. The behavior of this operation is undefined if the specified Collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified Collection is this list, and this list is nonempty.)

  This method performs any necessary type conversion.

  Specified by:
    `addAll` in interface `java.util.Collection`
  Specified by:
    `addAll` in interface `java.util.List`
  Overrides:
    `addAll` in class `java.util.ArrayList`
  Parameters:
    `c` - the elements to be inserted into this list.
  Returns:
    `true` if this list changed as a result of the call.
  Throws:
    `java.lang.NullPointerException` - if the specified collection is null.

### addAll

    public boolean addAll(int index,
                          java.util.Collection c)

  Inserts all of the elements in the specified Collection into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the list in the order that they are returned by the specified Collection's iterator.

  This method is guaranteed to work since it will create empty beans to fill the gap between the current list size and the requested index to enable the element to be set. This method also performs any necessary type conversion.

  Specified by:
    `addAll` in interface `java.util.List`
  Overrides:
    `addAll` in class `java.util.ArrayList`
  Parameters:
    `index` - index at which to insert first element from the specified collection.
    `c` - elements to be inserted into this list.
  Returns:
    `true` if this list changed as a result of the call.

### get

    public java.lang.Object get(int index)

  Returns the element at the specified position in this list.

  An object is guaranteed to be returned since it will create empty beans to fill the gap between the current list size and the requested index.

  Specified by:
    `get` in interface `java.util.List`
  Overrides:
    `get` in class `java.util.ArrayList`
  Parameters:
    `index` - index of element to return.
  Returns:
    the element at the specified position in this list.

### set

    public java.lang.Object set(int index,
                                java.lang.Object element)

  Replaces the element at the specified position in this list with the specified element.

  This method is guaranteed to work since it will create empty beans to fill the gap between the current list size and the requested index to enable the element to be set. This method also performs any necessary type conversion.

  Specified by:
    `set` in interface `java.util.List`
  Overrides:
    `set` in class `java.util.ArrayList`
  Parameters:
    `index` - index of element to replace.
    `element` - element to be stored at the specified position.
  Returns:
    the element previously at the specified position.

### contains

    public boolean contains(java.lang.Object element)

  Specified by:
    `contains` in interface `java.util.Collection`
  Specified by:
    `contains` in interface `java.util.List`
  Overrides:
    `contains` in class `java.util.ArrayList`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.