| Constructor and Description |
|---|
ShortGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(InRange range)
Tells this generator to produce values within a specified minimum and/or
maximum, inclusive, with uniform distribution.
|
Short |
generate(SourceOfRandomness random,
GenerationStatus status) |
protected Predicate<Short> |
inRange() |
protected Short |
leastMagnitude() |
BigDecimal |
magnitude(Object value) |
protected Function<BigInteger,Short> |
narrow() |
protected Short |
negate(Short target)
Used when shrinking negative numbers to add the positive equivalent
value at the top of shrinks list.
|
protected boolean |
negative(Short target) |
doShrink, widenaddComponentGenerators, 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.minShort() and InRange.maxShort(), if non-empty.range - annotation that gives the range's constraintspublic Short generate(SourceOfRandomness random, GenerationStatus status)
protected Function<BigInteger,Short> narrow()
narrow in class IntegralGenerator<Short>BigInteger into the equivalent
value in the base typeprotected Predicate<Short> inRange()
inRange in class IntegralGenerator<Short>protected Short leastMagnitude()
leastMagnitude in class IntegralGenerator<Short>protected boolean negative(Short target)
negative in class IntegralGenerator<Short>protected Short negate(Short target)
IntegralGeneratornegate in class IntegralGenerator<Short>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