jApp
Class LongVariable

java.lang.Object
  extended by jApp.Changeable
      extended by jApp.Variable
          extended by jApp.LongVariable
All Implemented Interfaces:
ValueInterface

public class LongVariable
extends Variable


Field Summary
 
Fields inherited from class jApp.Variable
m_Value
 
Fields inherited from interface jApp.ValueInterface
VALUE_VALID
 
Constructor Summary
LongVariable()
           
LongVariable(long v)
           
LongVariable(long v, long min, long max)
           
 
Method Summary
 void setValue(long value)
           
 void setValue(java.lang.Object value)
           
 void showAlertDialog(int cause, Unit unit)
          Provided so that derived classes can provide their own specic alert dialogs in case an attempt is made to set the variable to an unacceptable value.
 int validate(java.lang.Object value)
          Validates the value and returns a constant describing the result
 boolean valueEquals(java.lang.Object value)
          Note that, in the case that the value is an instance of class Float or class Double, this may return true, even if the numerical values are not equal but when cast to long will compare equal.
 
Methods inherited from class jApp.Variable
booleanValue, doubleValue, getValue, intValue, isEnabled, longValue, numberOfValues, readVariables, setEnabled, stringValue, writeVariables
 
Methods inherited from class jApp.Changeable
addChangeListener, fireChangeEvent, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jApp.ValueInterface
addChangeListener, removeChangeListener
 

Constructor Detail

LongVariable

public LongVariable(long v,
                    long min,
                    long max)

LongVariable

public LongVariable(long v)

LongVariable

public LongVariable()
Method Detail

valueEquals

public boolean valueEquals(java.lang.Object value)
Note that, in the case that the value is an instance of class Float or class Double, this may return true, even if the numerical values are not equal but when cast to long will compare equal. This is because this uses ((Number)value).longValue() to obtain the value to compare with the variables value.

Overrides:
valueEquals in class Variable
Parameters:
value - the value to compare to the varible value.
Returns:
true if the values are equal

setValue

public void setValue(long value)

setValue

public void setValue(java.lang.Object value)
Specified by:
setValue in interface ValueInterface
Overrides:
setValue in class Variable

showAlertDialog

public void showAlertDialog(int cause,
                            Unit unit)
Description copied from class: Variable
Provided so that derived classes can provide their own specic alert dialogs in case an attempt is made to set the variable to an unacceptable value. s * @param cause an int value (defined by a derived class) that is the cause of the aler

Specified by:
showAlertDialog in interface ValueInterface
Overrides:
showAlertDialog in class Variable
unit - the unit in which to express the variable value or the value range.

validate

public int validate(java.lang.Object value)
Description copied from class: Variable
Validates the value and returns a constant describing the result

Specified by:
validate in interface ValueInterface
Overrides:
validate in class Variable
Parameters:
value - the value to validate
Returns:
by default returns ValueInterface.VALUE_VALID