Package toxi.util.datatypes
Class FloatRange
java.lang.Object
toxi.util.datatypes.FloatRange
- Direct Known Subclasses:
BiasedFloatRange
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatadjustCurrentBy(float val) copy()static FloatRangefromSamples(float... samples) static FloatRangefromSamples(List<Float> samples) final floatgetAt(float perc) Returns the value at the normalized position(0.0 = min ...floatfloatfloatgetRange()booleanisValueInRange(float val) floatseed(long seed) floatsetCurrent(float val) Float[]toArray(float step) toString()
-
Field Details
-
min
public float min -
max
public float max -
currValue
public float currValue
-
-
Constructor Details
-
FloatRange
public FloatRange() -
FloatRange
public FloatRange(float min, float max)
-
-
Method Details
-
fromSamples
-
fromSamples
-
adjustCurrentBy
public float adjustCurrentBy(float val) -
copy
-
getAt
public final float getAt(float 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 float getCurrent() -
getMedian
public float getMedian() -
getRange
public float getRange() -
isValueInRange
public boolean isValueInRange(float val) -
pickRandom
public float pickRandom() -
seed
-
setCurrent
public float setCurrent(float val) -
setRandom
-
toArray
-
toString
-