| Constructor and Description |
|---|
FloatGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(InRange range)
Tells this generator to produce values within a specified minimum
(inclusive) and/or maximum (exclusive) with uniform distribution.
|
Float |
generate(SourceOfRandomness random,
GenerationStatus status) |
protected Predicate<Float> |
inRange() |
protected Float |
leastMagnitude() |
BigDecimal |
magnitude(Object value) |
protected Function<BigDecimal,Float> |
narrow() |
protected Float |
negate(Float target)
Used when shrinking negative numbers to add the positive equivalent
value at the top of shrinks list.
|
protected boolean |
negative(Float target) |
protected Function<Float,BigDecimal> |
widen() |
doShrinkaddComponentGenerators, canGenerateForParametersOfTypes, canRegisterAsType, canShrink, compatibleWithTypeParameter, configurationAnnotationsOn, configure, configure, copy, gen, gen, hasComponents, narrow, numberOfNeededComponents, provide, shrink, typespublic void configure(InRange range)
InRange.min() and InRange.max() take precedence over
InRange.minFloat() and InRange.maxFloat(), if non-empty.range - annotation that gives the range's constraintspublic Float generate(SourceOfRandomness random, GenerationStatus status)
protected Function<Float,BigDecimal> widen()
widen in class DecimalGenerator<Float>BigDecimalprotected Function<BigDecimal,Float> narrow()
narrow in class DecimalGenerator<Float>BigDecimal into the equivalent
value in the base typeprotected Predicate<Float> inRange()
inRange in class DecimalGenerator<Float>protected Float leastMagnitude()
leastMagnitude in class DecimalGenerator<Float>protected boolean negative(Float target)
negative in class DecimalGenerator<Float>protected Float negate(Float target)
DecimalGeneratornegate in class DecimalGenerator<Float>target - always a negative numberpublic BigDecimal magnitude(Object value)
© Copyright 2010-2020 Paul R. Holser, Jr. All rights reserved. Licensed under The MIT License. pholser@alumni.rice.edu