plugins.adufour.vars.lang
Class VarInteger

java.lang.Object
  extended by plugins.adufour.vars.lang.Var<N>
      extended by plugins.adufour.vars.lang.VarNumber<java.lang.Integer>
          extended by plugins.adufour.vars.lang.VarInteger
All Implemented Interfaces:
icy.file.xml.XMLPersistent, java.lang.Comparable<java.lang.Integer>, VarListener<java.lang.Integer>
Direct Known Subclasses:
VarTrigger

public class VarInteger
extends VarNumber<java.lang.Integer>


Field Summary
 
Fields inherited from class plugins.adufour.vars.lang.Var
listeners, NO_VALUE, type, XML_KEY_ID
 
Constructor Summary
VarInteger(java.lang.String name, int defaultValue)
           
VarInteger(java.lang.String name, java.lang.Integer defaultValue)
          Deprecated. use VarInteger(String, int) instead
 
Method Summary
 int compareTo(java.lang.Integer integer)
           
 java.lang.Integer getValue()
          Returns a Float representing the variable value.
NOTE: if the current variable references a variable of different (wider) type, truncation will occur
 java.lang.Integer parse(java.lang.String s)
          Parses the given String into the current type
 
Methods inherited from class plugins.adufour.vars.lang.VarNumber
createVarEditor, isAssignableFrom
 
Methods inherited from class plugins.adufour.vars.lang.Var
addListener, createVarViewer, fireVariableChanged, fireVariableChanged, getDefaultEditorModel, getDefaultValue, getIterableReferrers, getName, getReference, getReferencingPolicy, getReferrers, getType, getTypeAsString, getValue, getValueAsString, getValueAsString, isEnabled, isOptional, isReferenced, loadFromXML, prettyPrint, referenceChanged, removeListener, removeListeners, saveToXML, setDefaultEditorModel, setEnabled, setOptional, setReference, setReferencingPolicy, setValue, toString, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VarInteger

public VarInteger(java.lang.String name,
                  java.lang.Integer defaultValue)
Deprecated. use VarInteger(String, int) instead

Parameters:
name -
defaultValue -

VarInteger

public VarInteger(java.lang.String name,
                  int defaultValue)
Method Detail

parse

public java.lang.Integer parse(java.lang.String s)
Description copied from class: Var
Parses the given String into the current type

Overrides:
parse in class Var<java.lang.Integer>
Returns:
The variable value corresponding to the given string

compareTo

public int compareTo(java.lang.Integer integer)

getValue

public java.lang.Integer getValue()
Returns a Float representing the variable value.
NOTE: if the current variable references a variable of different (wider) type, truncation will occur

Overrides:
getValue in class Var<java.lang.Integer>
Returns:
the value stored in this variable, or the value in the referenced variable if the reference is not null. Note that this method may return null. To forbid null values, use the Var.getValue(boolean) method instead.
See Also:
Var.getReference()