public interface RandomNumberType<T extends Comparable<? extends Number>>
Describes random numbers to create. This interface is required by AbstractRandomNumberProvider
in order to calculate a random number in the given range.
| Modifier and Type | Method and Description |
|---|---|
Class<T> |
getType()
Type of the number.
|
T |
max()
The maximum value supported for this number type.
|
T |
min()
The minimum value supported for this number type.
|
T |
percentOf(double percent,
T value)
Return the percentage of the given value.
|
T |
sum(T value1,
T value2)
Create the sum of the two values.
|
@Nonnull T min()
The minimum value supported for this number type. Typically used as default minimum value.
@Nonnull T max()
The maximum value supported for this number type. Typically used as default maximum value.
@Nonnull T sum(T value1, T value2)
Create the sum of the two values.
value1 - first valuevalue2 - second value@Nonnull T percentOf(double percent, T value)
Return the percentage of the given value. Typically used to locate a number in a given range on the provided numerical ray.
percent - percent ranging between 0 and 1value - value to calculate the percentage ofCopyright © 2011-2013 CoreMedia AG. All Rights Reserved.