it.gotoandplay.smartfoxserver.data
Class UserVariable

java.lang.Object
  extended by it.gotoandplay.smartfoxserver.data.UserVariable
Direct Known Subclasses:
RoomVariable

public class UserVariable
extends java.lang.Object

The UserVariable object holds custom user data which is auto-updated between all clients in the same room(s).
You can learn more about user variables by following this tutorial.

Author:
(c) 2004-2007 gotoAndPlay() -- www.gotoandplay.it

Field Summary
static java.lang.String TYPE_BOOLEAN
           
static java.lang.String TYPE_NULL
           
static java.lang.String TYPE_NUMBER
           
static java.lang.String TYPE_STRING
           
 
Constructor Summary
UserVariable(boolean value)
           
UserVariable(double value)
           
UserVariable(int value)
           
UserVariable(java.lang.String value)
           
UserVariable(java.lang.String value, java.lang.String type)
          Deprecated.  
 
Method Summary
 boolean getBooleanValue()
           
 double getDoubleValue()
           
 int getIntValue()
           
 java.lang.String getType()
           
 java.lang.String getValue()
           
 void setType(java.lang.String type)
          Set the variable type
 void setValue(boolean value)
           
 void setValue(double value)
           
 void setValue(int value)
           
 void setValue(java.lang.String value)
          Set the variable value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NULL

public static java.lang.String TYPE_NULL

TYPE_BOOLEAN

public static java.lang.String TYPE_BOOLEAN

TYPE_NUMBER

public static java.lang.String TYPE_NUMBER

TYPE_STRING

public static java.lang.String TYPE_STRING
Constructor Detail

UserVariable

public UserVariable(java.lang.String value,
                    java.lang.String type)
Deprecated. 

Default constructor

Parameters:
value - var value
type - var type

UserVariable

public UserVariable(java.lang.String value)

UserVariable

public UserVariable(int value)

UserVariable

public UserVariable(double value)

UserVariable

public UserVariable(boolean value)
Method Detail

setType

public void setType(java.lang.String type)
Set the variable type

Parameters:
type - the type

getType

public java.lang.String getType()
Returns:
the variable type

setValue

public void setValue(java.lang.String value)
Set the variable value

Parameters:
value - the value

setValue

public void setValue(int value)

setValue

public void setValue(double value)

setValue

public void setValue(boolean value)

getValue

public java.lang.String getValue()
Returns:
the variable value

getIntValue

public int getIntValue()

getDoubleValue

public double getDoubleValue()

getBooleanValue

public boolean getBooleanValue()