| Modifier and Type | Field and Description |
|---|---|
| public static final ComparatorFactory |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static < type of expected and precision, which should be the subclass of java.lang.Number and java.lang.Comparable T extends Number> BigDecimal | Returns: the built BigDecimalthe Number to convert number)Convert to a precise BigDecimal object using an intermediate String. |
| public Comparator | |
| public Comparator | |
| private static < type of number to compare including the precision T extends Number> boolean | Returns: whether true if the abs(expected - precision) is <= precision, false otherwise.the actual value actual, T the expected value expected, T the acceptable precision precision)Returns true if the abs(expected - precision) is <= precision, false otherwise. |
| INSTANCE | back to summary |
|---|---|
| public static final ComparatorFactory INSTANCE | |
| ComparatorFactory | back to summary |
|---|---|
| public ComparatorFactory() | |
| asBigDecimal | back to summary |
|---|---|
| private static <T extends Number> BigDecimal asBigDecimal(T number) Convert to a precise BigDecimal object using an intermediate String.
| |
| doubleComparatorWithPrecision | back to summary |
|---|---|
| public Comparator | |
| floatComparatorWithPrecision | back to summary |
|---|---|
| public Comparator | |
| isWithinPrecision | back to summary |
|---|---|
| private static <T extends Number> boolean isWithinPrecision(T actual, T expected, T precision) Returns true if the abs(expected - precision) is <= precision, false otherwise.
| |