Packagecom.smartfoxserver.v2.entities.data
Interfacepublic interface ISFSArray
Implementors SFSArray

The ISFSArray interface defines all the public methods and properties of the SFSArray class used by SmartFoxServer in client-server data transfer. Read the implementor class description for additional informations.

NOTE: where mentioned in the "See also" section of the members descriptions below, check the SFSDataType class for more informations on data types conversion in ActionScript 3.

See also

SFSArray
SFSDataType


Public Methods
 MethodDefined By
  
addBool(value:Boolean):void
Appends a boolean value to the end of this array.
ISFSArray
  
addBoolArray(value:Array):void
Appends an array of boolean values to the end of this array.
ISFSArray
  
addByte(value:int):void
Appends a byte (8 bit) value to the end of this array.
ISFSArray
  
addByteArray(value:ByteArray):void
Appends an array of bytes to the end of this array.
ISFSArray
  
addClass(value:*):void
Appends the passed custom class instance to the end of this array.
ISFSArray
  
addDouble(value:Number):void
Appends a double precision number (64 bit) value to the end of this array.
ISFSArray
  
addDoubleArray(value:Array):void
Appends an array of double precision number values to the end of this array.
ISFSArray
  
addFloat(value:Number):void
Appends a floating point number (32 bit) value to the end of this array.
ISFSArray
  
addFloatArray(value:Array):void
Appends an array of floating point number values to the end of this array.
ISFSArray
  
addInt(value:int):void
Appends an integer (32 bit) value to the end of this array.
ISFSArray
  
addIntArray(value:Array):void
Appends an array of integer values to the end of this array.
ISFSArray
  
addLong(value:Number):void
Appends a long integer (64 bit) value to the end of this array.
ISFSArray
  
addLongArray(value:Array):void
Appends an array of long integer values to the end of this array.
ISFSArray
  
addNull():void
Appends a null value to the end of this array.
ISFSArray
  
Appends a ISFSArray object to the end of this array.
ISFSArray
  
Appends a ISFSObject object to the end of this array.
ISFSArray
  
addShort(value:int):void
Appends a short integer (16 bit) value to the end of this array.
ISFSArray
  
addShortArray(value:Array):void
Appends an array of short integer values to the end of this array.
ISFSArray
  
addText(value:String):void
Appends a UTF-8 string (with max length of 2 GBytes) to the end of this array.
ISFSArray
  
addUtfString(value:String):void
Appends a UTF-8 string (with max length of 32 KBytes) to the end of this array.
ISFSArray
  
addUtfStringArray(value:Array):void
Appends an array of UTF-8 string values to the end of this array.
ISFSArray
  
contains(obj:*):Boolean
Indicates whether this array contains the specified object or not.
ISFSArray
  
getBool(index:int):Boolean
Returns the element at the specified position as a boolean.
ISFSArray
  
getBoolArray(index:int):Array
Returns the element at the specified position as an array of booleans.
ISFSArray
  
getByte(index:int):int
Returns the element at the specified position as a signed byte (8 bit).
ISFSArray
  
getByteArray(index:int):ByteArray
Returns the element at the specified position as an array of bytes.
ISFSArray
  
getClass(index:int):*
Returns the element at the specified position as an instance of a custom class.
ISFSArray
  
getDouble(index:int):Number
Returns the element at the specified position as a double precision number.
ISFSArray
  
getDoubleArray(index:int):Array
Returns the element at the specified position as an array of double precision numbers.
ISFSArray
  
getDump(format:Boolean = true):String
Provides a formatted string representing this array.
ISFSArray
  
getElementAt(index:int):*
Returns the element at the specified position in this array.
ISFSArray
  
getFloat(index:int):Number
Returns the element at the specified position as a floating point number.
ISFSArray
  
getFloatArray(index:int):Array
Returns the element at the specified position as an array of floating point numbers.
ISFSArray
  
getHexDump():String
Provides a detailed hexadecimal representation of this array.
ISFSArray
  
getInt(index:int):int
Returns the element at the specified position as an integer (32 bit).
ISFSArray
  
getIntArray(index:int):Array
Returns the element at the specified position as an array of integers.
ISFSArray
  
getLong(index:int):Number
Returns the element at the specified position as a long integer (64 bit).
ISFSArray
  
getLongArray(index:int):Array
Returns the element at the specified position as an array of long integers.
ISFSArray
  
Returns the element at the specified position as an ISFSArray object.
ISFSArray
  
Returns the element at the specified position as an ISFSObject object.
ISFSArray
  
getShort(index:int):int
Returns the element at the specified position as a short integer (16 bit).
ISFSArray
  
getShortArray(index:int):Array
Returns the element at the specified position as an array of short integers.
ISFSArray
  
getText(index:int):String
Returns the element at the specified position as a UTF-8 string, with max length of 2 Gbytes.
ISFSArray
  
getUnsignedByte(index:int):int
Returns the element at the specified position as an unsigned byte (8 bit).
ISFSArray
  
getUnsignedByteArray(index:int):Array
Returns the element at the specified position as an array of unsigned bytes.
ISFSArray
  
getUtfString(index:int):String
Returns the element at the specified position as a UTF-8 string, with max length of 32 KBytes.
ISFSArray
  
getUtfStringArray(index:int):Array
Returns the element at the specified position as an array of UTF-8 strings.
ISFSArray
  
isNull(index:int):Boolean
Indicates if the element at the specified position in this array is null.
ISFSArray
  
removeElementAt(index:int):*
Removes the element at the specified position in this array.
ISFSArray
  
size():int
Indicates the number of elements in this array.
ISFSArray
  
toBinary():ByteArray
Provides the binary form of this array.
ISFSArray
Method Detail
addBool()method
public function addBool(value:Boolean):void

Appends a boolean value to the end of this array.

Parameters

value:Boolean — The value to be appended to this array.

addBoolArray()method 
public function addBoolArray(value:Array):void

Appends an array of boolean values to the end of this array.

Parameters

value:Array — The array of Boolean values to be appended to this array.

addByte()method 
public function addByte(value:int):void

Appends a byte (8 bit) value to the end of this array.

Parameters

value:int — The value to be appended to this array.

See also

addByteArray()method 
public function addByteArray(value:ByteArray):void

Appends an array of bytes to the end of this array.

Parameters

value:ByteArray — The array of int values to be appended to this array.

See also

addClass()method 
public function addClass(value:*):void

Appends the passed custom class instance to the end of this array. Read the getClass() method description for more informations.

Parameters

value:* — The custom class instance to be appended to this array.

See also

addDouble()method 
public function addDouble(value:Number):void

Appends a double precision number (64 bit) value to the end of this array.

Parameters

value:Number — The value to be appended to this array.

See also

addDoubleArray()method 
public function addDoubleArray(value:Array):void

Appends an array of double precision number values to the end of this array.

Parameters

value:Array — The array of Number values to be appended to this array.

See also

addFloat()method 
public function addFloat(value:Number):void

Appends a floating point number (32 bit) value to the end of this array.

Parameters

value:Number — The value to be appended to this array.

See also

addFloatArray()method 
public function addFloatArray(value:Array):void

Appends an array of floating point number values to the end of this array.

Parameters

value:Array — The array of Number values to be appended to this array.

See also

addInt()method 
public function addInt(value:int):void

Appends an integer (32 bit) value to the end of this array.

Parameters

value:int — The value to be appended to this array.

addIntArray()method 
public function addIntArray(value:Array):void

Appends an array of integer values to the end of this array.

Parameters

value:Array — The array of int values to be appended to this array.

addLong()method 
public function addLong(value:Number):void

Appends a long integer (64 bit) value to the end of this array.

Parameters

value:Number — The value to be appended to this array.

See also

addLongArray()method 
public function addLongArray(value:Array):void

Appends an array of long integer values to the end of this array.

Parameters

value:Array — The array of Number values to be appended to this array.

See also

addNull()method 
public function addNull():void

Appends a null value to the end of this array.

addSFSArray()method 
public function addSFSArray(value:ISFSArray):void

Appends a ISFSArray object to the end of this array.

Parameters

value:ISFSArray — The object implementing the ISFSArray interface to be appended to this array.

addSFSObject()method 
public function addSFSObject(value:ISFSObject):void

Appends a ISFSObject object to the end of this array.

Parameters

value:ISFSObject — The object implementing the ISFSObject interface to be appended to this array.

addShort()method 
public function addShort(value:int):void

Appends a short integer (16 bit) value to the end of this array.

Parameters

value:int — The value to be appended to this array.

See also

addShortArray()method 
public function addShortArray(value:Array):void

Appends an array of short integer values to the end of this array.

Parameters

value:Array — The array of int values to be appended to this array.

See also

addText()method 
public function addText(value:String):void

Appends a UTF-8 string (with max length of 2 GBytes) to the end of this array.

Parameters

value:String — The value to be appended to this array.

addUtfString()method 
public function addUtfString(value:String):void

Appends a UTF-8 string (with max length of 32 KBytes) to the end of this array.

Parameters

value:String — The value to be appended to this array.

addUtfStringArray()method 
public function addUtfStringArray(value:Array):void

Appends an array of UTF-8 string values to the end of this array.

Parameters

value:Array — The array of String values to be appended to this array.

contains()method 
public function contains(obj:*):Boolean

Indicates whether this array contains the specified object or not.

Parameters

obj:* — The object whose presence in this array is to be tested.

Returns
Booleantrue if the specified object is present.
getBool()method 
public function getBool(index:int):Boolean

Returns the element at the specified position as a boolean.

Parameters

index:int — The position of the element to return.

Returns
Boolean — The element of this array at the specified index.
getBoolArray()method 
public function getBoolArray(index:int):Array

Returns the element at the specified position as an array of booleans.

Parameters

index:int — The position of the element to return.

Returns
Array — The element of this array as an array of Boolean values.
getByte()method 
public function getByte(index:int):int

Returns the element at the specified position as a signed byte (8 bit).

Parameters

index:int — The position of the element to return.

Returns
int — The element of this array at the specified index.

See also

getByteArray()method 
public function getByteArray(index:int):ByteArray

Returns the element at the specified position as an array of bytes.

Parameters

index:int — The position of the element to return.

Returns
ByteArray — The element of this array as a ByteArray.
getClass()method 
public function getClass(index:int):*

Returns the element at the specified position as an instance of a custom class.

This advanced feature allows the transmission of specific object instances between client-side ActionScript and server-side Java provided that the respective class definitions on both sides have the same package name and they implement the SerializableSFSType interface.

Parameters

index:int — The position of the element to return.

Returns
* — The element of this array as a generic Object type to be casted to the target class definition.

Example
The following example shows the same class on the client and server sides, which can be transferred back and forth with the getClass() and addClass() methods. The server-side Java definition of a SpaceShip class is:
         
         package my.game.spacecombat
         
         public class SpaceShip implements SerializableSFSType
         {
             private String type;
             private String name;
             private int firePower;
             private int maxSpeed;
             private List<String> weapons;
             
             public SpaceShip(String name, String type)
             {
                 this.name = name;
                 this.type = type;
             }
             
             // Getters/Setters
             
             ...
         }
         
The client-side ActionScript 3 definition of the SpaceShip class is:
         
         package my.game.spacecombat
         
         public class SpaceShip implements SerializableSFSType
         {
             private var _type:String;
             private var _name:String;
             private var _firePower:int;
             private var _maxSpeed:int;
             private var _weapons:Array;
             
             public function SpaceShip(name:String, type:String)
             {
                 _name = name;
                 _type = type;
             }
             
             // Getters/Setters
             
             ...
         }
         
A SpaceShip instance is sent by the server to the client in the first position of an array. This is how to retrieve it:
         
         var myShipData:SpaceShip = sfsArray.getClass(0) as SpaceShip;
         
getDouble()method 
public function getDouble(index:int):Number

Returns the element at the specified position as a double precision number.

Parameters

index:int — The position of the element to return.

Returns
Number — The element of this array at the specified index.

See also

getDoubleArray()method 
public function getDoubleArray(index:int):Array

Returns the element at the specified position as an array of double precision numbers.

Parameters

index:int — The position of the element to return.

Returns
Array — The element of this array as an array of Number values.

See also

getDump()method 
public function getDump(format:Boolean = true):String

Provides a formatted string representing this array. The returned string can be logged or traced in the console for debugging purposes.

Parameters

format:Boolean (default = true) — If true, the output is formatted in a human-readable way.

Returns
String — The string representation of this array.
getElementAt()method 
public function getElementAt(index:int):*

Returns the element at the specified position in this array.

Parameters

index:int — The position of the element to return.

Returns
* — The element at the specified index in this array.
getFloat()method 
public function getFloat(index:int):Number

Returns the element at the specified position as a floating point number.

Parameters

index:int — The position of the element to return.

Returns
Number — The element of this array at the specified index.

See also

getFloatArray()method 
public function getFloatArray(index:int):Array

Returns the element at the specified position as an array of floating point numbers.

Parameters

index:int — The position of the element to return.

Returns
Array — The element of this array as an array of Number values.

See also

getHexDump()method 
public function getHexDump():String

Provides a detailed hexadecimal representation of this array. The returned string can be logged or traced in the console for debugging purposes.

Returns
String — The hexadecimal string representation of this array.
getInt()method 
public function getInt(index:int):int

Returns the element at the specified position as an integer (32 bit).

Parameters

index:int — The position of the element to return.

Returns
int — The element of this array at the specified index.
getIntArray()method 
public function getIntArray(index:int):Array

Returns the element at the specified position as an array of integers.

Parameters

index:int — The position of the element to return.

Returns
Array — The element of this array as an array of int values.
getLong()method 
public function getLong(index:int):Number

Returns the element at the specified position as a long integer (64 bit).

Parameters

index:int — The position of the element to return.

Returns
Number — The element of this array at the specified index.

See also

getLongArray()method 
public function getLongArray(index:int):Array

Returns the element at the specified position as an array of long integers.

Parameters

index:int — The position of the element to return.

Returns
Array — The element of this array as an array of Number values.

See also

getSFSArray()method 
public function getSFSArray(index:int):ISFSArray

Returns the element at the specified position as an ISFSArray object.

Parameters

index:int — The position of the element to return.

Returns
ISFSArray — The element of this array as an object implementing the ISFSArray interface.
getSFSObject()method 
public function getSFSObject(index:int):ISFSObject

Returns the element at the specified position as an ISFSObject object.

Parameters

index:int — The position of the element to return.

Returns
ISFSObject — The element of this array as an object implementing the ISFSObject interface.
getShort()method 
public function getShort(index:int):int

Returns the element at the specified position as a short integer (16 bit).

Parameters

index:int — The position of the element to return.

Returns
int — The element of this array at the specified index.

See also

getShortArray()method 
public function getShortArray(index:int):Array

Returns the element at the specified position as an array of short integers.

Parameters

index:int — The position of the element to return.

Returns
Array — The element of this array as an array of int values.

See also

getText()method 
public function getText(index:int):String

Returns the element at the specified position as a UTF-8 string, with max length of 2 Gbytes.

Parameters

index:int — The position of the element to return.

Returns
String — The element of this array at the specified index.
getUnsignedByte()method 
public function getUnsignedByte(index:int):int

Returns the element at the specified position as an unsigned byte (8 bit).

Parameters

index:int — The position of the element to return.

Returns
int — The element of this array at the specified index.

See also

getUnsignedByteArray()method 
public function getUnsignedByteArray(index:int):Array

Returns the element at the specified position as an array of unsigned bytes.

Parameters

index:int — The position of the element to return.

Returns
Array — The element of this array as an array of int values.

See also

getUtfString()method 
public function getUtfString(index:int):String

Returns the element at the specified position as a UTF-8 string, with max length of 32 KBytes.

Parameters

index:int — The position of the element to return.

Returns
String — The element of this array at the specified index.
getUtfStringArray()method 
public function getUtfStringArray(index:int):Array

Returns the element at the specified position as an array of UTF-8 strings.

Parameters

index:int — The position of the element to return.

Returns
Array — The element of this array as an array of String values.
isNull()method 
public function isNull(index:int):Boolean

Indicates if the element at the specified position in this array is null.

Parameters

index:int — The position of the element to be checked.

Returns
Booleantrue if the element of this array at the specified position is null.
removeElementAt()method 
public function removeElementAt(index:int):*

Removes the element at the specified position in this array.

Parameters

index:int — The position of the element to be removed.

Returns
* — The element that was removed.
size()method 
public function size():int

Indicates the number of elements in this array.

Returns
int — The number of elements in this array.
toBinary()method 
public function toBinary():ByteArray

Provides the binary form of this array.

Returns
ByteArray — The binary data representing this array.