plugins.adufour.vars.gui.model
Class IntegerRangeModel

java.lang.Object
  extended by plugins.adufour.vars.gui.model.RangeModel<java.lang.Integer>
      extended by plugins.adufour.vars.gui.model.IntegerRangeModel
All Implemented Interfaces:
VarEditorModel<java.lang.Integer>

public class IntegerRangeModel
extends RangeModel<java.lang.Integer>


Nested Class Summary
 
Nested classes/interfaces inherited from class plugins.adufour.vars.gui.model.RangeModel
RangeModel.RangeEditorType
 
Field Summary
 
Fields inherited from class plugins.adufour.vars.gui.model.RangeModel
defaultValue, labels, max, min, step
 
Constructor Summary
IntegerRangeModel(java.lang.Integer defaultValue, java.lang.Integer min, java.lang.Integer max, java.lang.Integer step)
           
IntegerRangeModel(java.lang.Integer defaultValue, java.lang.Integer min, java.lang.Integer max, java.lang.Integer step, RangeModel.RangeEditorType editorType)
           
 
Method Summary
 int getRangeSize()
           
 java.lang.Integer getValueForIndex(int index)
           
 int indexOf(java.lang.Integer value)
          Calculates the index of the specified value within the range, according to the current minimum value and step
 boolean isValid(java.lang.Integer value)
           
 
Methods inherited from class plugins.adufour.vars.gui.model.RangeModel
getDefaultValue, getEditorType, getLabels, getMaximum, getMinimum, getStepSize, setEditorType, setMaximum, setMinimum, setStepSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerRangeModel

public IntegerRangeModel(java.lang.Integer defaultValue,
                         java.lang.Integer min,
                         java.lang.Integer max,
                         java.lang.Integer step)

IntegerRangeModel

public IntegerRangeModel(java.lang.Integer defaultValue,
                         java.lang.Integer min,
                         java.lang.Integer max,
                         java.lang.Integer step,
                         RangeModel.RangeEditorType editorType)
Method Detail

isValid

public boolean isValid(java.lang.Integer value)

getRangeSize

public int getRangeSize()
Specified by:
getRangeSize in class RangeModel<java.lang.Integer>
Returns:
the number of values covered by this range, i.e., (max - min) / step

getValueForIndex

public java.lang.Integer getValueForIndex(int index)
Specified by:
getValueForIndex in class RangeModel<java.lang.Integer>
Returns:
the value corresponding to the specified zero-based index, i.e., min + index * step

indexOf

public int indexOf(java.lang.Integer value)
Description copied from class: RangeModel
Calculates the index of the specified value within the range, according to the current minimum value and step

Specified by:
indexOf in class RangeModel<java.lang.Integer>
Returns:
the number of step from the minimum to the specified value