Package toxi.util.datatypes
Class DoubleRange
java.lang.Object
toxi.util.datatypes.DoubleRange
- Direct Known Subclasses:
BiasedDoubleRange
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
adjustCurrentBy
(double val) copy()
static DoubleRange
fromSamples
(double... samples) static DoubleRange
fromSamples
(List<Double> samples) final double
getAt
(double perc) Returns the value at the normalized position(0.0 = min ...
double
double
double
getRange()
boolean
isValueInRange
(float val) double
seed
(long seed) double
setCurrent
(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
-