Module io.github.mmm.base
Package io.github.mmm.base.range
Interface NumberRange<N extends Number & Comparable<?>>
- Type Parameters:
N- type of the containedNumbervalues.
- All Superinterfaces:
Range<N>
- All Known Implementing Classes:
NumberRangeBean,NumberRangeType
-
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 -
Method Summary
Modifier and TypeMethodDescriptiondefault Ndefault NfromFactor(double factor) default NumberType<N> getType()default doubledefault NMethods inherited from interface io.github.mmm.base.range.Range
clip, contains, getComparator, getMax, getMin, intersection, isUnbounded, with, withMax, withMin
-
Method Details
-
getType
- Returns:
- the
NumberTypeof this range. May benullif unbounded.
-
wrap
This methodwrapsthe givenvalueso the result iscontainedin thisRangeunless the givenvalueisnull.- Parameters:
value- is the vale to clip. May benull.- Returns:
- the given
valuewrappedto this range.
-
clip
- Parameters:
value- is the vale to clip. May benull.wrap- -trueforwrap(Number),falseforRange.clip(Comparable).- Returns:
clipifwrapwasfalseandwrapotherwise (ifwrapwastrue).
-
fromFactor
- 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
-