Top Description Constructors Methods
com.google.common.math

pack-priv final Class MathPreconditions

extends Object
Class Inheritance
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, com.google.errorprone.annotations.CanIgnoreReturnValue, java.math.BigInteger, .RoundingMode

A collection of preconditions for math functions.
Author
Louis Wasserman

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
checkInRangeForRoundingInputs(boolean condition, double input, RoundingMode mode)

pack-priv static int
checkNonNegative(String role, int x)

pack-priv static long
checkNonNegative(String role, long x)

pack-priv static BigInteger
pack-priv static double
checkNonNegative(String role, double x)

pack-priv static void
checkNoOverflow(boolean condition, String methodName, int a, int b)

pack-priv static void
checkNoOverflow(boolean condition, String methodName, long a, long b)

pack-priv static int
checkPositive(String role, int x)

pack-priv static long
checkPositive(String role, long x)

pack-priv static BigInteger
pack-priv static void
checkRoundingUnnecessary(boolean condition)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MathPreconditionsback to summary
private MathPreconditions()

Method Detail

checkInRangeForRoundingInputsback to summary
pack-priv static void checkInRangeForRoundingInputs(boolean condition, double input, RoundingMode mode)
checkNonNegativeback to summary
pack-priv static int checkNonNegative(String role, int x)
Annotations
@CanIgnoreReturnValue
checkNonNegativeback to summary
pack-priv static long checkNonNegative(String role, long x)
Annotations
@CanIgnoreReturnValue
checkNonNegativeback to summary
pack-priv static BigInteger checkNonNegative(String role, BigInteger x)
Annotations
@CanIgnoreReturnValue
checkNonNegativeback to summary
pack-priv static double checkNonNegative(String role, double x)
Annotations
@CanIgnoreReturnValue
checkNoOverflowback to summary
pack-priv static void checkNoOverflow(boolean condition, String methodName, int a, int b)
checkNoOverflowback to summary
pack-priv static void checkNoOverflow(boolean condition, String methodName, long a, long b)
checkPositiveback to summary
pack-priv static int checkPositive(String role, int x)
Annotations
@CanIgnoreReturnValue
checkPositiveback to summary
pack-priv static long checkPositive(String role, long x)
Annotations
@CanIgnoreReturnValue
checkPositiveback to summary
pack-priv static BigInteger checkPositive(String role, BigInteger x)
Annotations
@CanIgnoreReturnValue
checkRoundingUnnecessaryback to summary
pack-priv static void checkRoundingUnnecessary(boolean condition)