com.orsoncharts.util

## Class ArgChecks

- java.lang.Object
- - com.orsoncharts.util.ArgChecks

-     public final class ArgChecks
      extends java.lang.Object

  Utility methods for argument checking. Throughout Orson Charts, arguments passed to methods are validated and exceptions thrown for invalid cases (the idea is to fail fast, which usually helps when tracking down errors in programming logic).

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `checkArrayBounds(int index, java.lang.String name, int arrayLimit)` Checks that the index is less than the specified `arrayLimit` and throws an `IllegalArgumentException` if it is not.
    `static void` | `finitePositiveRequired(double value, java.lang.String name)` Checks if the specified argument is finite and positive and, if it is NOT, throws an `IllegalArgumentException`.
    `static void` | `finiteRequired(double value, java.lang.String name)` Checks if the specified argument is finite and, if it is NOT, throws an `IllegalArgumentException`.
    `static void` | `negativeNotPermitted(double value, java.lang.String name)` Checks if the specified argument is negative and, if it is, throws an `IllegalArgumentException`.
    `static void` | `nullNotPermitted(java.lang.Object arg, java.lang.String name)` Checks if the specified argument is `null` and, if it is, throws an `IllegalArgumentException`.
    `static void` | `positiveRequired(double value, java.lang.String name)` Checks if the specified argument is positive and, if it is NOT, throws an `IllegalArgumentException`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### nullNotPermitted

          public static void nullNotPermitted(java.lang.Object arg,
                                              java.lang.String name)

      Checks if the specified argument is `null` and, if it is, throws an `IllegalArgumentException`.
      Parameters:
        `arg` - the argument to check (`null` permitted).
        `name` - the parameter name (`null` not permitted).

    - #### negativeNotPermitted

          public static void negativeNotPermitted(double value,
                                                  java.lang.String name)

      Checks if the specified argument is negative and, if it is, throws an `IllegalArgumentException`.
      Parameters:
        `value` - the value.
        `name` - the parameter name (`null` not permitted).

    - #### positiveRequired

          public static void positiveRequired(double value,
                                              java.lang.String name)

      Checks if the specified argument is positive and, if it is NOT, throws an `IllegalArgumentException`.
      Parameters:
        `value` - the value.
        `name` - the parameter name (`null` not permitted).

    - #### finiteRequired

          public static void finiteRequired(double value,
                                            java.lang.String name)

      Checks if the specified argument is finite and, if it is NOT, throws an `IllegalArgumentException`.
      Parameters:
        `value` - the value.
        `name` - the parameter name (`null` not permitted).
      Since:
        1.4

    - #### finitePositiveRequired

          public static void finitePositiveRequired(double value,
                                                    java.lang.String name)

      Checks if the specified argument is finite and positive and, if it is NOT, throws an `IllegalArgumentException`.
      Parameters:
        `value` - the value.
        `name` - the parameter name (`null` not permitted).
      Since:
        1.4

    - #### checkArrayBounds

          public static void checkArrayBounds(int index,
                                              java.lang.String name,
                                              int arrayLimit)

      Checks that the index is less than the specified `arrayLimit` and throws an `IllegalArgumentException` if it is not.
      Parameters:
        `index` - the array index.
        `name` - the parameter name (to display in the error message).
        `arrayLimit` - the array size.