org.omus.data
Class DataList

java.lang.Object
  |
  +--org.omus.data.DataField
        |
        +--org.omus.data.DataList
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class DataList
extends DataField

The class corresponding to the Array object in ActionScript. When an array is sent to to the server, it will be converted to a DataList instance and each element of the array is converted to the corresponding DataField.

See Also:
Serialized Form

Inner Class Summary
static interface DataList.Comparator
          DataList.Comparators can be passed to the sort method of DataList to allow precise control over the sort order.
 
Constructor Summary
DataList(java.lang.String n)
          Creates a new DataList with the specified name.
DataList(java.lang.String n, DataList dl)
          Creates a new DataList with the specified name and the same DataFields as the specified DataList.
 
Method Summary
 void accept(FieldVisitor fv)
          Accepts a visitor.
 void add(DataField df)
          Appends the specified DataField to the end of this list.
 void add(int idx, DataField df)
          Inserts the specified DataField at the specified position in this list.
 void addAll(DataList list)
          Appends all the DataFields of the specified DataList to the end of this list.
 void addAll(int idx, DataList list)
          Inserts all the DataFields of the specified DataList at the specified position in this list.
 java.lang.Object clone()
          Returns a deep copy of this DataList.
 DataField get(int idx)
          Returns the element at the specified position in this list.
 java.util.Iterator iterator()
          Returns an iterator over the elements in this list.
 DataField remove(int idx)
          Removes and returns the DataField at the specified index position.
 void removeAll()
          Removes all elements from this list.
 int size()
          Returns the number of DataFields of this DataList.
 void sort(DataList.Comparator listComp)
          Sorts the list according to the order induced by the specified comparator.
 java.lang.String toString()
           
 
Methods inherited from class org.omus.data.DataField
addListener, appendMarshalledField, getMarshalledField, getName, removeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataList

public DataList(java.lang.String n)
Creates a new DataList with the specified name.

DataList

public DataList(java.lang.String n,
                DataList dl)
Creates a new DataList with the specified name and the same DataFields as the specified DataList.
Method Detail

size

public int size()
Returns the number of DataFields of this DataList.

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this list.

remove

public DataField remove(int idx)
Removes and returns the DataField at the specified index position.

removeAll

public void removeAll()
Removes all elements from this list.

add

public void add(DataField df)
Appends the specified DataField to the end of this list.

add

public void add(int idx,
                DataField df)
Inserts the specified DataField at the specified position in this list.

addAll

public void addAll(DataList list)
Appends all the DataFields of the specified DataList to the end of this list. The order of the elements of the sprecified DataList will be preserved.

addAll

public void addAll(int idx,
                   DataList list)
Inserts all the DataFields of the specified DataList at the specified position in this list. The order of the elements of the sprecified DataList will be preserved.

get

public DataField get(int idx)
Returns the element at the specified position in this list.

sort

public void sort(DataList.Comparator listComp)
Sorts the list according to the order induced by the specified comparator.

accept

public void accept(FieldVisitor fv)
Description copied from class: DataField
Accepts a visitor. The visitor pattern is useful if you want to extend the functionality of all DataFields without modifying their API.
Overrides:
accept in class DataField

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Returns a deep copy of this DataList.
Overrides:
clone in class DataField