Class ArgumentUtils


  • final class ArgumentUtils
    extends java.lang.Object
    Utilities for argument validation.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ArgumentUtils()
      No instances.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void checkProbability​(double p)
      Check the probability p is in the interval [0, 1].
      (package private) static boolean isFiniteStrictlyPositive​(double x)
      Checks if the value x is finite and strictly positive.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArgumentUtils

        private ArgumentUtils()
        No instances.
    • Method Detail

      • isFiniteStrictlyPositive

        static boolean isFiniteStrictlyPositive​(double x)
        Checks if the value x is finite and strictly positive.
        Parameters:
        x - Value
        Returns:
        true if x > 0 and is finite
      • checkProbability

        static void checkProbability​(double p)
        Check the probability p is in the interval [0, 1].
        Parameters:
        p - Probability
        Throws:
        java.lang.IllegalArgumentException - if p < 0 or p > 1