org.omus.data
Class DataRow

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

public class DataRow
extends DataField

The class corresponding to the generic Object in ActionScript. When an object is sent to the server, it will be converted to a DataRow instance and each property of the ActionScript object is converted to the corresponding DataField and put into the DataRow instance. DataRow is similar to java.util.Map, but the keys are limited to Strings and the values are limited to DataFields. If you want to map a server-side DataRow to a custom client-side ActionScript class, you can use the setASClass method in DataRow. In addition this class must be registered with the same name with the register method in the client-side org.omus.Class object.

See Also:
Serialized Form

Constructor Summary
DataRow(java.lang.String n)
          Creates a new DataRow with the specified name.
DataRow(java.lang.String n, DataRow dr)
          Creates a new DataRow with the specified name and the same DataFields as the specified DataRow.
 
Method Summary
 void accept(FieldVisitor fv)
          Accepts a visitor.
 java.lang.Object clone()
          Returns a deep copy of this DataRow.
 boolean contains(java.lang.String name)
          Returns true if this DataRow contains a DataField with the specified name.
 DataField get(java.lang.String name)
          Returns the DataField with the specified name or null if no such DataField exists.
 java.lang.String getASClass()
          Returns the registered name of an ActionScript class or null if none has been set.
 java.util.Iterator iterator()
          Returns an iterator over the DataFields in this DataRow.
 void put(DataField df)
          Adds the specified DataField to this DataRow.
 void putAll(DataRow row)
          Adds all DataFields of the specified DataRow to this DataRow.
 DataField remove(java.lang.String name)
          Removes and returns the DataField with the specified name.
 void removeAll()
          Removes all DataFields from this DataRow.
 void setASClass(java.lang.String className)
          Sets the name of the ActionScript class for this DataRow to the specified string.
 int size()
          Returns the number of DataFields of this DataRow.
 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

DataRow

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

DataRow

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

size

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

iterator

public java.util.Iterator iterator()
Returns an iterator over the DataFields in this DataRow.

contains

public boolean contains(java.lang.String name)
Returns true if this DataRow contains a DataField with the specified name.

remove

public DataField remove(java.lang.String name)
Removes and returns the DataField with the specified name. Returns null if no such DataField exists.

removeAll

public void removeAll()
Removes all DataFields from this DataRow.

put

public void put(DataField df)
Adds the specified DataField to this DataRow.

putAll

public void putAll(DataRow row)
Adds all DataFields of the specified DataRow to this DataRow.

get

public DataField get(java.lang.String name)
Returns the DataField with the specified name or null if no such DataField exists.

getASClass

public java.lang.String getASClass()
Returns the registered name of an ActionScript class or null if none has been set.

setASClass

public void setASClass(java.lang.String className)
Sets the name of the ActionScript class for this DataRow to the specified string. The objects can only be sent to the client and converted to the corresponding custom ActionScript objects, if a constructor with a corresponding name was registered with the client. See the section about the Class object in the Client API.

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 DataRow.
Overrides:
clone in class DataField

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