it.gotoandplay.smartfoxserver.data
Class RoomVariable

java.lang.Object
  extended by it.gotoandplay.smartfoxserver.data.UserVariable
      extended by it.gotoandplay.smartfoxserver.data.RoomVariable

public class RoomVariable
extends UserVariable

The RoomVariable object stores the properties of each Room Variables of a Room object.

For a detailed overview of the Room and Room Variables check this tutorial.

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

Field Summary
 
Fields inherited from class it.gotoandplay.smartfoxserver.data.UserVariable
TYPE_BOOLEAN, TYPE_NULL, TYPE_NUMBER, TYPE_STRING
 
Constructor Summary
RoomVariable(boolean value, User owner, boolean persistent, boolean priv)
          Create a Room variable with a Boolean value
RoomVariable(double value, User owner, boolean persistent, boolean priv)
          Create a Room variable with a Double value
RoomVariable(int value, User owner, boolean persistent, boolean priv)
          Create a Room variable with a int value
RoomVariable(java.lang.String value, java.lang.String type, User owner, boolean persistent, boolean priv)
          Deprecated.  
RoomVariable(java.lang.String value, User owner, boolean persistent, boolean priv)
          Create a Room variable with a String value
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks if two variables are the same (overrides parent java.lang.Object method)
 User getOwner()
           
 boolean isPersistent()
           
 boolean isPrivate()
           
 void setOwner(User who)
          Set the variable owner
 void setPersistent(boolean b)
          Set the persistent flag
 void setPrivate(boolean b)
          Set the private flag
 java.lang.String toString()
           
 
Methods inherited from class it.gotoandplay.smartfoxserver.data.UserVariable
getBooleanValue, getDoubleValue, getIntValue, getType, getValue, setType, setValue, setValue, setValue, setValue, setValue
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoomVariable

public RoomVariable(java.lang.String value,
                    java.lang.String type,
                    User owner,
                    boolean persistent,
                    boolean priv)
Deprecated. 

Default constructor

Parameters:
value - value
type - type, can be:
  • "s" - string
  • "n" - number
  • "b" - boolean
  • "x" - null
Please note that boolean values should be expressed as "1" for true and "0" for false.
owner - the user who created the variable, if null the Server is the owner
persistent - persistent flag
priv - private flag

RoomVariable

public RoomVariable(java.lang.String value,
                    User owner,
                    boolean persistent,
                    boolean priv)
Create a Room variable with a String value

Parameters:
value - the variable value (String)
owner - the user who created the variable, if null the Server is the owner
persistent - if true the variable will exist until the User is connected in the system, otherwise the variable will be removed when the user leaves the Room
priv - if true only the owner of a variable can change/delete it

RoomVariable

public RoomVariable(int value,
                    User owner,
                    boolean persistent,
                    boolean priv)
Create a Room variable with a int value

Parameters:
value - the variable value (int)
owner - the user who created the variable, if null the Server is the owner
persistent - if true the variable will exist until the User is connected in the system, otherwise the variable will be removed when the user leaves the Room
priv - if true only the owner of a variable can change/delete it

RoomVariable

public RoomVariable(double value,
                    User owner,
                    boolean persistent,
                    boolean priv)
Create a Room variable with a Double value

Parameters:
value - the variable value (Double)
owner - the user who created the variable, if null the Server is the owner
persistent - if true the variable will exist until the User is connected in the system, otherwise the variable will be removed when the user leaves the Room
priv - if true only the owner of a variable can change/delete it

RoomVariable

public RoomVariable(boolean value,
                    User owner,
                    boolean persistent,
                    boolean priv)
Create a Room variable with a Boolean value

Parameters:
value - the variable value (Boolean)
owner - the user who created the variable, if null the Server is the owner
persistent - if true the variable will exist until the User is connected in the system, otherwise the variable will be removed when the user leaves the Room
priv - if true only the owner of a variable can change/delete it
Method Detail

isPersistent

public boolean isPersistent()
Returns:
true if variable is persistent

getOwner

public User getOwner()
Returns:
the variable owner

isPrivate

public boolean isPrivate()
Returns:
true if the variable is private

setPersistent

public void setPersistent(boolean b)
Set the persistent flag

Parameters:
b -

setPrivate

public void setPrivate(boolean b)
Set the private flag

Parameters:
b -

setOwner

public void setOwner(User who)
Set the variable owner

Parameters:
who - the owner

equals

public boolean equals(java.lang.Object o)
Checks if two variables are the same (overrides parent java.lang.Object method)

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object