Package toxi.util.datatypes
Class DoubleRange
java.lang.Object
toxi.util.datatypes.DoubleRange
- Direct Known Subclasses:
BiasedDoubleRange
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleadjustCurrentBy(double val) copy()static DoubleRangefromSamples(double... samples) static DoubleRangefromSamples(List<Double> samples) final doublegetAt(double perc) Returns the value at the normalized position(0.0 = min ...doubledoubledoublegetRange()booleanisValueInRange(float val) doubleseed(long seed) doublesetCurrent(double val) Double[]toArray(double step) toString()
-
Field Details
-
min
public double min -
max
public double max -
currValue
public double currValue
-
-
Constructor Details
-
DoubleRange
public DoubleRange() -
DoubleRange
public DoubleRange(double min, double max)
-
-
Method Details
-
fromSamples
-
fromSamples
-
adjustCurrentBy
public double adjustCurrentBy(double val) -
copy
-
getAt
public final double getAt(double perc) Returns the value at the normalized position(0.0 = min ... 1.0 = max-EPS)within the range. Since the max value is exclusive, the value returned for position 1.0 is the range max value minusMathUtils.EPS. Also note the given position is not being clipped to the 0.0-1.0 interval, so when passing in values outside that interval will produce out-of-range values too.- Parameters:
perc-- Returns:
- value within the range
-
getCurrent
public double getCurrent() -
getMedian
public double getMedian() -
getRange
public double getRange() -
isValueInRange
public boolean isValueInRange(float val) -
pickRandom
public double pickRandom() -
seed
-
setCurrent
public double setCurrent(double val) -
setRandom
-
toArray
-
toString
-