Module io.github.mmm.ui.spi.core
Package io.github.mmm.ui.spi.range
Class NumericRange<V extends Number>
- java.lang.Object
-
- io.github.mmm.base.range.AbstractRange<V>
-
- io.github.mmm.ui.spi.range.NumericRange<V>
-
- Type Parameters:
V- type of the contained values.
- All Implemented Interfaces:
Range<V>,WritableRange<V>
public class NumericRange<V extends Number> extends AbstractRange<V> implements WritableRange<V>
Implementation ofWritableRangeforUiNumericInput.- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from interface io.github.mmm.base.range.Range
BOUND_END_EXCLUSIVE, BOUND_END_INCLUSIVE, BOUND_SEPARATOR, BOUND_START_EXCLUSIVE, BOUND_START_INCLUSIVE, MAX_UNBOUND, MIN_UNBOUND, PROPERTY_MAX, PROPERTY_MIN
-
-
Constructor Summary
Constructors Constructor Description NumericRange(NumberType<V> type)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VfromFactor(double factor)VgetMax()VgetMin()protected voidonValueChange()voidsetMax(V max)voidsetMin(V min)voidsetValidator(Validator<? super V> validator)doubletoFactor(V value)-
Methods inherited from class io.github.mmm.base.range.AbstractRange
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.base.range.Range
clip, contains, getComparator
-
-
-
-
Constructor Detail
-
NumericRange
public NumericRange(NumberType<V> type)
The constructor.- Parameters:
type- theNumberType.
-
-
Method Detail
-
getMin
public V getMin()
-
setMin
public void setMin(V min)
- Specified by:
setMinin interfaceWritableRange<V extends Number>- Parameters:
min- the new value ofRange.getMin().
-
getMax
public V getMax()
-
setMax
public void setMax(V max)
- Specified by:
setMaxin interfaceWritableRange<V extends Number>- Parameters:
max- the new value ofRange.getMax().
-
setValidator
public void setValidator(Validator<? super V> validator)
- Parameters:
validator- theValidatorto apply.
-
fromFactor
public V fromFactor(double factor)
- Parameters:
factor- the scaled value in the range from0to1.- Returns:
- the value within this range scaled by the given
factor. It will beminin case the givenfactoris0, while0is used in caseminisnull. In case thefactoris1, it will returnmaxor the maximum value instead ofnull. Any other factor is interpolated betweenminandmax.
-
toFactor
public double toFactor(V value)
-
onValueChange
protected void onValueChange()
-
-