T - type of values this generator producespublic abstract class DecimalGenerator<T extends Number> extends Generator<T>
double and
BigDecimal. All numbers are converted to/from BigDecimal for
processing.| Modifier | Constructor and Description |
|---|---|
protected |
DecimalGenerator(Class<T> type) |
protected |
DecimalGenerator(List<Class<T>> types) |
| Modifier and Type | Method and Description |
|---|---|
List<T> |
doShrink(SourceOfRandomness random,
T largestGeneric) |
protected abstract Predicate<T> |
inRange() |
protected abstract T |
leastMagnitude() |
protected abstract Function<BigDecimal,T> |
narrow() |
protected abstract T |
negate(T target)
Used when shrinking negative numbers to add the positive equivalent
value at the top of shrinks list.
|
protected abstract boolean |
negative(T target) |
protected abstract Function<T,BigDecimal> |
widen() |
addComponentGenerators, canGenerateForParametersOfTypes, canRegisterAsType, canShrink, compatibleWithTypeParameter, configurationAnnotationsOn, configure, configure, copy, gen, gen, hasComponents, magnitude, narrow, numberOfNeededComponents, provide, shrink, typespublic List<T> doShrink(SourceOfRandomness random, T largestGeneric)
protected abstract Function<T,BigDecimal> widen()
BigDecimalprotected abstract Function<BigDecimal,T> narrow()
BigDecimal into the equivalent
value in the base typeprotected abstract Predicate<T> inRange()
protected abstract T leastMagnitude()
protected abstract boolean negative(T target)
© Copyright 2010-2020 Paul R. Holser, Jr. All rights reserved. Licensed under The MIT License. pholser@alumni.rice.edu