jwo.landserf.script
Class ScriptVariable

java.lang.Object
  extended by jwo.landserf.script.ScriptVariable

public class ScriptVariable
extends Object

Stores a LandScript variable. This can be a numeric scalar value, a string or an entire spatial object.

Version:
2.3, 13th July, 2006
Author:
Jo Wood

Field Summary
static int RASTER_VAR
          Indicates that variable stores a raster map.
static int SCALAR_VAR
          Indicates that variable is scalar.
static int SPATIAL_VAR
          Indicates that variable stores an unspecified spatial object.
static int STRING_VAR
          Indicates that variable is a string.
static int VECTOR_VAR
          Indicates that variable stores a vector map.
 
Constructor Summary
ScriptVariable(int varType, Object varValue)
          Stores the given variable value of the given type.
 
Method Summary
 int getType()
          Reports the type of variable stored.
 String getTypeAsString()
          Reports the type of variable stored as a string message.
static String getTypeAsString(int type)
          Reports the given variable type as a string message.
 Object getValue()
          Reports the contents of the stored variable.
 void setValue(Object newValue)
          Sets the contents of the stored variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALAR_VAR

public static final int SCALAR_VAR
Indicates that variable is scalar.

See Also:
Constant Field Values

STRING_VAR

public static final int STRING_VAR
Indicates that variable is a string.

See Also:
Constant Field Values

RASTER_VAR

public static final int RASTER_VAR
Indicates that variable stores a raster map.

See Also:
Constant Field Values

VECTOR_VAR

public static final int VECTOR_VAR
Indicates that variable stores a vector map.

See Also:
Constant Field Values

SPATIAL_VAR

public static final int SPATIAL_VAR
Indicates that variable stores an unspecified spatial object.

See Also:
Constant Field Values
Constructor Detail

ScriptVariable

public ScriptVariable(int varType,
                      Object varValue)
Stores the given variable value of the given type.

Parameters:
varType - Type of variable to store (SCALAR_VAR, RASTER_VAR etc.).
varValue - Value of the variable.
Method Detail

getType

public int getType()
Reports the type of variable stored.

Returns:
Type of variable stored (SCALAR_VAR, RASTER_VAR etc.).

getValue

public Object getValue()
Reports the contents of the stored variable.

Returns:
Stored variable.

setValue

public void setValue(Object newValue)
Sets the contents of the stored variable. Note that the value provided should be compatible with the type returned by getType().

Parameters:
newValue - New value to be stored.

getTypeAsString

public String getTypeAsString()
Reports the type of variable stored as a string message.

Returns:
Text describing the type of variable

getTypeAsString

public static String getTypeAsString(int type)
Reports the given variable type as a string message.

Parameters:
type - Type of variable. Should be one of SCALAR_VAR, STRING_VAR, RASTER_VAR, VECTOR_VAR or SPATIAL_VAR.
Returns:
Text describing the type of variable


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009