sophware.home.logic
Class Variable

java.lang.Object
  extended by sophware.home.lang.StateObject
      extended by sophware.home.logic.Variable
All Implemented Interfaces:
java.io.Serializable, Named

public class Variable
extends StateObject
implements Named, java.io.Serializable

Variable is used to store a value.

Version:
1.0, 02/17/06
Author:
Russell Soph
See Also:
Serialized Form

Constructor Summary
Variable(java.lang.String name)
          Constructs a Variable
Variable(java.lang.String name, java.lang.Object value)
          Constructs a Variable
 
Method Summary
 java.lang.String getName()
          Gets the variable name
 java.lang.Object getValue()
          Gets the current value
 void setValue(java.lang.Object value)
          Assigns new value to the variable.
 boolean stateEquals(java.lang.Object o)
          compares current value to given object
 
Methods inherited from class sophware.home.lang.StateObject
addStateChangeListener, fireStateChange, removeStateChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variable

public Variable(java.lang.String name)
Constructs a Variable

Parameters:
name - variable name

Variable

public Variable(java.lang.String name,
                java.lang.Object value)
Constructs a Variable

Parameters:
name - variable name
value - initial value
Method Detail

getName

public java.lang.String getName()
Gets the variable name

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

getValue

public java.lang.Object getValue()
Gets the current value

Returns:
the variable's current value

setValue

public void setValue(java.lang.Object value)
Assigns new value to the variable.

Parameters:
value - the variable's new value

stateEquals

public boolean stateEquals(java.lang.Object o)
compares current value to given object

Specified by:
stateEquals in class StateObject
Parameters:
o - an object state