com.swath
Class UserVariable

java.lang.Object
  extended bycom.swath.UserVariable

public final class UserVariable
extends java.lang.Object

This class represents a user variable. Several value types are supported.

Since:
SWATH 1.7
See Also:
Swath.getUserVariable(java.lang.String, boolean), Swath.setUserVariable(java.lang.String, com.swath.UserVariable, boolean), Swath.delUserVariable(java.lang.String, boolean)

Field Summary
static int BOOLEAN
          The boolean value type.
static int DOUBLE
          The double value type.
static int INTEGER
          The integer value type.
static int NONE
          No value type.
static int STRING
          The string value type.
 
Constructor Summary
UserVariable()
          Constructor.
 
Method Summary
 boolean getBoolean()
          Gets a boolean value.
 double getDouble()
          Gets a double value.
 int getInteger()
          Gets an integer value.
 java.lang.String getString()
          Gets a string value.
 int getType()
          Gets the type of this user variable.
 java.lang.Object getValue()
          Gets the value as an object.
 boolean isValid()
          Indicates if the user variable is valid or not.
 void setBoolean(boolean val)
          Sets a boolean value.
 void setDouble(double val)
          Sets a double value.
 void setInteger(int val)
          Sets an integer value.
 void setString(java.lang.String val)
          Sets a string value.
 java.lang.String toString()
          Returns a string representation of the user variable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
No value type.

See Also:
Constant Field Values

STRING

public static final int STRING
The string value type.

See Also:
Constant Field Values

BOOLEAN

public static final int BOOLEAN
The boolean value type.

See Also:
Constant Field Values

INTEGER

public static final int INTEGER
The integer value type.

See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
The double value type.

See Also:
Constant Field Values
Constructor Detail

UserVariable

public UserVariable()
Constructor.

Since:
SWATH 1.7
Method Detail

toString

public java.lang.String toString()
Returns a string representation of the user variable.

Returns:
The string representation.
Since:
SWATH 1.7

isValid

public boolean isValid()
Indicates if the user variable is valid or not.

Returns:
true if valid, otherwise false.
Since:
SWATH 1.7

getType

public int getType()
Gets the type of this user variable.

Returns:
The variable type.
Since:
SWATH 1.7
See Also:
STRING, BOOLEAN, INTEGER, DOUBLE

getValue

public java.lang.Object getValue()
Gets the value as an object.

Returns:
The value or null if none.
Since:
SWATH 1.7

setString

public void setString(java.lang.String val)
Sets a string value.

Parameters:
val - The string value.
Since:
SWATH 1.7

getString

public java.lang.String getString()
Gets a string value.

Returns:
The string value.
Since:
SWATH 1.7

setBoolean

public void setBoolean(boolean val)
Sets a boolean value.

Parameters:
val - The boolean value.
Since:
SWATH 1.7

getBoolean

public boolean getBoolean()
Gets a boolean value.

Returns:
The boolean value.
Since:
SWATH 1.7

setInteger

public void setInteger(int val)
Sets an integer value.

Parameters:
val - The integer value.
Since:
SWATH 1.7

getInteger

public int getInteger()
Gets an integer value.

Returns:
The integer value.
Since:
SWATH 1.7

setDouble

public void setDouble(double val)
Sets a double value.

Parameters:
val - The double value.
Since:
SWATH 1.7

getDouble

public double getDouble()
Gets a double value.

Returns:
The double value.
Since:
SWATH 1.7