Constructor and Description |
---|
IntegerGenerator() |
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.
|
Integer |
generate(SourceOfRandomness random,
GenerationStatus status) |
protected Predicate<Integer> |
inRange() |
protected Integer |
leastMagnitude() |
protected Function<BigInteger,Integer> |
narrow() |
protected Integer |
negate(Integer target) |
protected boolean |
negative(Integer target) |
doShrink, widen
addComponentGenerators, canGenerateForParametersOfTypes, canRegisterAsType, canShrink, compatibleWithTypeParameter, configurationAnnotationsOn, configure, configure, gen, hasComponents, narrow, numberOfNeededComponents, provide, shrink, types
public void configure(InRange range)
InRange.min()
and InRange.max()
take precedence over
InRange.minInt()
and InRange.maxInt()
, if non-empty.range
- annotation that gives the range's constraintspublic Integer generate(SourceOfRandomness random, GenerationStatus status)
protected Function<BigInteger,Integer> narrow()
narrow
in class IntegralGenerator<Integer>
protected Predicate<Integer> inRange()
inRange
in class IntegralGenerator<Integer>
protected Integer leastMagnitude()
leastMagnitude
in class IntegralGenerator<Integer>
protected boolean negative(Integer target)
negative
in class IntegralGenerator<Integer>
protected Integer negate(Integer target)
negate
in class IntegralGenerator<Integer>
© Copyright 2010-2016 Paul R. Holser, Jr. All rights reserved. Licensed under The MIT License. pholser@alumni.rice.edu