com.waveset.expression
Class DynamicList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended bycom.waveset.expression.DynamicList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class DynamicList
extends java.util.ArrayList

An extension of ArrayList that alters the get and set methods.

Calling set with an index that is greater than the current size of the list will automatically extend the list to necessary size, filling new elements with null.

Calling get with an index that is greater than the current size returns null.

See Also:
Serialized Form

Field Summary
static java.lang.String code_id
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DynamicList()
          Build a dynamic list.
 
Method Summary
 java.lang.Object get(int index)
          Return an element of the list.
 java.lang.Object set(int index, java.lang.Object o)
          Assign a value to a list element.
static java.lang.Object setAndExtend(java.util.List list, int index, java.lang.Object o)
          Exposed as a static so it can be used as a standalone utility for extending lists.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, indexOf, isEmpty, lastIndexOf, 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, remove, 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, remove, removeAll, retainAll, subList
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

DynamicList

public DynamicList()
Build a dynamic list.

Method Detail

get

public java.lang.Object get(int index)
Return an element of the list. If the index is out of range, null is returned.


set

public java.lang.Object set(int index,
                            java.lang.Object o)
Assign a value to a list element. If the index is out of range, the list is extended to the necessary size, and new elements are assigned null.


setAndExtend

public static java.lang.Object setAndExtend(java.util.List list,
                                            int index,
                                            java.lang.Object o)
Exposed as a static so it can be used as a standalone utility for extending lists.