plugins.adufour.vars.gui.model
Class IntegerRangeModel
java.lang.Object
plugins.adufour.vars.gui.model.RangeModel<java.lang.Integer>
plugins.adufour.vars.gui.model.IntegerRangeModel
- All Implemented Interfaces:
- VarEditorModel<java.lang.Integer>
public class IntegerRangeModel
- extends RangeModel<java.lang.Integer>
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
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