sfs2x.client.entities.variables
Class BaseVariable

java.lang.Object
  extended by sfs2x.client.entities.variables.BaseVariable
All Implemented Interfaces:
Variable
Direct Known Subclasses:
MMOItemVariable, SFSBuddyVariable, SFSRoomVariable, SFSUserVariable

public class BaseVariable
extends java.lang.Object
implements Variable


Constructor Summary
BaseVariable(java.lang.String name, java.lang.Object val)
           
BaseVariable(java.lang.String name, java.lang.Object value, int type)
           
 
Method Summary
 java.lang.Boolean getBoolValue()
          Get the value of the variable as Boolean
 java.lang.Double getDoubleValue()
          Get the value of the variable as Double
 java.lang.Integer getIntValue()
          Get the value of the variable as Integer
 java.lang.String getName()
          Return the name of the variable
 com.smartfoxserver.v2.entities.data.ISFSArray getSFSArrayValue()
          Get the value of the variable as SFSArray
 com.smartfoxserver.v2.entities.data.ISFSObject getSFSObjectValue()
          Get the value of the variable as SFSObject
 java.lang.String getStringValue()
          Get the value of the variable as String
 int getType()
          Return the data type of the variable
 java.lang.Object getValue()
          Get the value of the variable as Object
 boolean isNull()
          Test if a variable is null
 com.smartfoxserver.v2.entities.data.ISFSArray toSFSArray()
          Private
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseVariable

public BaseVariable(java.lang.String name,
                    java.lang.Object val)

BaseVariable

public BaseVariable(java.lang.String name,
                    java.lang.Object value,
                    int type)
Method Detail

getName

public java.lang.String getName()
Return the name of the variable

Specified by:
getName in interface Variable
Returns:
the variable's name

getType

public int getType()
Return the data type of the variable

Specified by:
getType in interface Variable
Returns:
the data type of the variable

getValue

public java.lang.Object getValue()
Get the value of the variable as Object

Specified by:
getValue in interface Variable
Returns:
the value of the variable as Object

getBoolValue

public java.lang.Boolean getBoolValue()
Get the value of the variable as Boolean

Specified by:
getBoolValue in interface Variable
Returns:
the value of the variable as Boolean

getIntValue

public java.lang.Integer getIntValue()
Get the value of the variable as Integer

Specified by:
getIntValue in interface Variable
Returns:
the value of the variable as Integer

getDoubleValue

public java.lang.Double getDoubleValue()
Get the value of the variable as Double

Specified by:
getDoubleValue in interface Variable
Returns:
the value of the variable as Double

getStringValue

public java.lang.String getStringValue()
Get the value of the variable as String

Specified by:
getStringValue in interface Variable
Returns:
the value of the variable as String

getSFSObjectValue

public com.smartfoxserver.v2.entities.data.ISFSObject getSFSObjectValue()
Get the value of the variable as SFSObject

Specified by:
getSFSObjectValue in interface Variable
Returns:
the value of the variable as SFSObject

getSFSArrayValue

public com.smartfoxserver.v2.entities.data.ISFSArray getSFSArrayValue()
Get the value of the variable as SFSArray

Specified by:
getSFSArrayValue in interface Variable
Returns:
the value of the variable as SFSArray

isNull

public boolean isNull()
Test if a variable is null

Specified by:
isNull in interface Variable
Returns:
true if the variable is null

toSFSArray

public com.smartfoxserver.v2.entities.data.ISFSArray toSFSArray()
Description copied from interface: Variable
Private

Specified by:
toSFSArray in interface Variable