Packagecom.electrotank.electroserver4.esobject
Classpublic class EsObject

This class is used to represent an EsObject. EsObject is used all through the API on both the client and server side of ElectroServer. It is a way to create an object with strictly typed properties. This object can be of unlimited depth and is understood by ActionScript 2, ActionScript 3, Java and any other language that has an ElectroServer API. With EsObject the client and server, or ActionScript and Java, can exchange custom deep data representations. EsObject is serialized with the smallest footprint possible. It is significantly smaller than other object serializers such as JSON and WDDX (xml serializer).

EsObject supports the following properties. Most are availabe in both ActionScript 2, and all are available in ActionScript 3.


Example
This example shows how to create a new EsObject and populate it with data.
    import com.electrotank.electroserver4.esobject.EsObject;
    var esob:EsObject = new EsObject();
    esob.setString("MyName", "Jobe");
    esob.setInteger("MyAge", 32);
    //create 2nd ob to place in first
    var esob2:EsObject = new EsObject();
    esob2.setString("TestVar", "test value");
    esob2.setBoolean("IsProgrammer", true);
    //place 2nd ob in first
    esob.setEsObject("MySecondOb", esob2);
    
     



Public Methods
 MethodDefined by
  
Creates a new instance of the EsObject class.
EsObject
  
doesPropertyExist(name:String):Boolean
Checks to see if a property exists on the EsObject.
EsObject
  
fromXML(info:XMLNode):void
EsObject
  
getBoolean(name:String):Boolean
Gets the value of the property based on a name..
EsObject
  
getBooleanArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getByte(name:String):int
Gets the value of the property based on a name..
EsObject
  
getByteArray(name:String):ByteArray
Gets the value of the property based on a name..
EsObject
  
getChar(name:String):String
Gets the value of the property based on a name..
EsObject
  
getCharArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getDataType(name:String):DataType
Returns the DataType of a property based on its name.
EsObject
  
getDouble(name:String):Number
Gets the value of the property based on a name..
EsObject
  
getDoubleArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getEntries():Array
Returns the list of entries on the object.
EsObject
  
getEsObject(name:String):EsObject
Gets the value of the property based on a name..
EsObject
  
getEsObjectArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getFloat(name:String):Number
Gets the value of the property based on a name..
EsObject
  
getFloatArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getInteger(name:String):Number
Gets the value of the property based on a name..
EsObject
  
getIntegerArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getLong(name:String):String
Gets the value of the property based on a name..
EsObject
  
getLongArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getNumber(name:String):Number
Gets the value of the property based on a name..
EsObject
  
getNumberArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getRawVariable(name:String):Object
Gets the value of a variable before it has been cast to any data type.
EsObject
  
getShort(name:String):Number
Gets the value of the property based on a name..
EsObject
  
getShortArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
getSize():Number
Returns the number of properties on the object.
EsObject
  
getString(name:String):String
Gets the value of the property based on a name..
EsObject
  
getStringArray(name:String):Array
Gets the value of the property based on a name..
EsObject
  
removeAll():void
Completely clears out the EsObject.
EsObject
  
removeVariable(name:String):void
Remove a variable from the EsObject that has the name passed in.
EsObject
  
setBoolean(name:String, value:Boolean):void
Sets a boolean onto the EsObject.
EsObject
  
setBooleanArray(name:String, value:Array):void
Sets an array of booleans onto the EsObject.
EsObject
  
setByte(name:String, value:int):void
Sets a byte onto the EsObject.
EsObject
  
setByteArray(name:String, value:ByteArray):void
Sets an array of bytes onto the EsObject.
EsObject
  
setChar(name:String, value:String):void
Sets a character onto the EsObject.
EsObject
  
setCharArray(name:String, value:Array):void
Sets an array of characters onto the EsObject.
EsObject
  
setDouble(name:String, value:Number):void
Sets a double onto the EsObject.
EsObject
  
setDoubleArray(name:String, value:Array):void
Sets an array of doubles onto the EsObject.
EsObject
  
setEsObject(name:String, value:EsObject):void
Sets an EsObject onto the EsObject.
EsObject
  
setEsObjectArray(name:String, value:Array):void
Sets an array of EsObjects onto the EsObject.
EsObject
  
setFloat(name:String, value:Number):void
Sets a float onto the EsObject.
EsObject
  
setFloatArray(name:String, value:Array):void
Sets an array of floats onto the EsObject.
EsObject
  
setInteger(name:String, value:Number):void
Sets an integer ont onto the EsObject.
EsObject
  
setIntegerArray(name:String, value:Array):void
Sets an array of integers onto the EsObject.
EsObject
  
setLong(name:String, value:String):void
Sets a long onto the EsObject.
EsObject
  
setLongArray(name:String, value:Array):void
Sets an array of longs onto the EsObject.
EsObject
  
setNumber(name:String, value:Number):void
Sets a number onto the EsObject.
EsObject
  
setNumberArray(name:String, value:Array):void
Sets an array of numbers onto the EsObject.
EsObject
  
setShort(name:String, value:Number):void
Sets a short onto the EsObject.
EsObject
  
setShortArray(name:String, value:Array):void
Sets an array of shorts onto the EsObject.
EsObject
  
setString(name:String, value:String):void
Sets a string onto the EsObject.
EsObject
  
setStringArray(name:String, value:Array):void
Sets an array of strings onto the EsObject.
EsObject
  
toString(tabs:String = null):String
EsObject
  
toXML(tabs:String = null):String
EsObject
Constructor detail
EsObject()constructor
public function EsObject()

Creates a new instance of the EsObject class.

Method detail
doesPropertyExist()method
public function doesPropertyExist(name:String):Boolean

Checks to see if a property exists on the EsObject. If it does then true is returned. Otherwise, false is returned.

Parameters
name:String — The name of the property to check for.

Returns
Boolean — True or false.
fromXML()method 
public function fromXML(info:XMLNode):voidParameters
info:XMLNode
getBoolean()method 
public function getBoolean(name:String):Boolean

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Boolean — The value of the property.
getBooleanArray()method 
public function getBooleanArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getByte()method 
public function getByte(name:String):int

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
int — The value of the property.
getByteArray()method 
public function getByteArray(name:String):ByteArray

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
ByteArray — The value of the property.
getChar()method 
public function getChar(name:String):String

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
String — The value of the property.
getCharArray()method 
public function getCharArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getDataType()method 
public function getDataType(name:String):DataType

Returns the DataType of a property based on its name.

Parameters
name:String — The name of the property.

Returns
DataType — The DataType of property.
getDouble()method 
public function getDouble(name:String):Number

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Number — The value of the property.
getDoubleArray()method 
public function getDoubleArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getEntries()method 
public function getEntries():Array

Returns the list of entries on the object. The value of each entry is of type EsObjectDataHolder.

Returns
Array — The list of entries on the object.
getEsObject()method 
public function getEsObject(name:String):EsObject

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
EsObject — The value of the property.
getEsObjectArray()method 
public function getEsObjectArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getFloat()method 
public function getFloat(name:String):Number

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Number — The value of the property.
getFloatArray()method 
public function getFloatArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getInteger()method 
public function getInteger(name:String):Number

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Number — The value of the property.
getIntegerArray()method 
public function getIntegerArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getLong()method 
public function getLong(name:String):String

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
String — The value of the property.
getLongArray()method 
public function getLongArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getNumber()method 
public function getNumber(name:String):Number

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Number — The value of the property.
getNumberArray()method 
public function getNumberArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getRawVariable()method 
public function getRawVariable(name:String):Object

Gets the value of a variable before it has been cast to any data type.

Parameters
name:String — Name of the variable to get.

Returns
Object — The raw value of the variable.
getShort()method 
public function getShort(name:String):Number

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Number — The value of the property.
getShortArray()method 
public function getShortArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
getSize()method 
public function getSize():Number

Returns the number of properties on the object.

Returns
Number — The number of properties on the object.
getString()method 
public function getString(name:String):String

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
String — The value of the property.
getStringArray()method 
public function getStringArray(name:String):Array

Gets the value of the property based on a name..

Parameters
name:String — Name of the property.

Returns
Array — The value of the property.
removeAll()method 
public function removeAll():void

Completely clears out the EsObject.

removeVariable()method 
public function removeVariable(name:String):void

Remove a variable from the EsObject that has the name passed in.

Parameters
name:String — Name of the variable to remove.
setBoolean()method 
public function setBoolean(name:String, value:Boolean):void

Sets a boolean onto the EsObject.

Parameters
name:String — Name of the boolean.
 
value:Boolean — Value of the boolean.
setBooleanArray()method 
public function setBooleanArray(name:String, value:Array):void

Sets an array of booleans onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setByte()method 
public function setByte(name:String, value:int):void

Sets a byte onto the EsObject.

Parameters
name:String — Name of the byte.
 
value:int — Value of the byte.
setByteArray()method 
public function setByteArray(name:String, value:ByteArray):void

Sets an array of bytes onto the EsObject.

Parameters
name:String — Name of the array.
 
value:ByteArray — The array.
setChar()method 
public function setChar(name:String, value:String):void

Sets a character onto the EsObject.

Parameters
name:String — Name of the character.
 
value:String — Value of the character.
setCharArray()method 
public function setCharArray(name:String, value:Array):void

Sets an array of characters onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setDouble()method 
public function setDouble(name:String, value:Number):void

Sets a double onto the EsObject.

Parameters
name:String — Name of the EsObject.
 
value:Number — Value of the EsObject.
setDoubleArray()method 
public function setDoubleArray(name:String, value:Array):void

Sets an array of doubles onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setEsObject()method 
public function setEsObject(name:String, value:EsObject):void

Sets an EsObject onto the EsObject.

Parameters
name:String — Name of the EsObject.
 
value:EsObject — Value of the EsObject.
setEsObjectArray()method 
public function setEsObjectArray(name:String, value:Array):void

Sets an array of EsObjects onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setFloat()method 
public function setFloat(name:String, value:Number):void

Sets a float onto the EsObject.

Parameters
name:String — Name of the float.
 
value:Number — Value of the float.
setFloatArray()method 
public function setFloatArray(name:String, value:Array):void

Sets an array of floats onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setInteger()method 
public function setInteger(name:String, value:Number):void

Sets an integer ont onto the EsObject.

Parameters
name:String — The name of the integer.
 
value:Number — The value of the integer.
setIntegerArray()method 
public function setIntegerArray(name:String, value:Array):void

Sets an array of integers onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setLong()method 
public function setLong(name:String, value:String):void

Sets a long onto the EsObject.

Parameters
name:String — Name of the long.
 
value:String — Value of the long.
setLongArray()method 
public function setLongArray(name:String, value:Array):void

Sets an array of longs onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setNumber()method 
public function setNumber(name:String, value:Number):void

Sets a number onto the EsObject.

Parameters
name:String — Name of the number.
 
value:Number — Value of the number.
setNumberArray()method 
public function setNumberArray(name:String, value:Array):void

Sets an array of numbers onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setShort()method 
public function setShort(name:String, value:Number):void

Sets a short onto the EsObject.

Parameters
name:String — Name of the short.
 
value:Number — Value of the short.
setShortArray()method 
public function setShortArray(name:String, value:Array):void

Sets an array of shorts onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
setString()method 
public function setString(name:String, value:String):void

Sets a string onto the EsObject.

Parameters
name:String — Name of the string.
 
value:String — Value of the string.
setStringArray()method 
public function setStringArray(name:String, value:Array):void

Sets an array of strings onto the EsObject.

Parameters
name:String — Name of the array.
 
value:Array — The array.
toString()method 
public function toString(tabs:String = null):StringParameters
tabs:String (default = null)

Returns
String
toXML()method 
public function toXML(tabs:String = null):StringParameters
tabs:String (default = null)

Returns
String