Package ej.bon

## Class Util

- java.lang.Object
- - ej.bon.Util

-     public class Util
      extends Object

  This class offers basic services for B-ON implementation.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Util()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static long` | `currentTimeMillis()` | Gets the application time in milliseconds.
    `static <T> T[]` | `newArray​(Class<T[]> type, int length)` | Allocates a new array of object references from the given array type and length.
    `static long` | `platformTimeMillis()` | Gets an arbitrary time in milliseconds.
    `static long` | `platformTimeNanos()` | Gets an arbitrary time in nanoseconds.
    `static void` | `setCurrentTimeMillis​(long t)` | Sets the application time.
    `static void` | `setCurrentTimeMillis​(Date d)` | Sets the application time.

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

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

- - ### Constructor Detail

    - #### Util

          public Util()

  - ### Method Detail

    - #### currentTimeMillis

          public static long currentTimeMillis()

      Gets the application time in milliseconds.

      The result of this method is the same as the `System.currentTimeMillis()` method one.

      Returns:
        the application time in milliseconds

    - #### platformTimeMillis

          public static long platformTimeMillis()

      Gets an arbitrary time in milliseconds.

      Only elapsed time between two calls is meaningful.

      Returns:
        the platform time in milliseconds

    - #### platformTimeNanos

          public static long platformTimeNanos()

      Gets an arbitrary time in nanoseconds.

      Only elapsed time between two calls is meaningful.

      Returns:
        the platform time in nanoseconds

    - #### setCurrentTimeMillis

          public static void setCurrentTimeMillis​(long t)

      Sets the application time.

      This time does not change the platform time.

      Parameters:
        `t` - the application time to set in milliseconds
      Throws:
        `IllegalArgumentException` - if `t` is negative

    - #### setCurrentTimeMillis

          public static void setCurrentTimeMillis​(Date d)

      Sets the application time.

      This time does not change the platform time. The `Util.setCurrentTimeMillis(d)` method has the same effect as `Util.setCurrentTimeMillis(d.getTime())`.

      Parameters:
        `d` - the application time to set

    - #### newArray

          public static <T> T[] newArray​(Class<T[]> type,
                                         int length)

      Allocates a new array of object references from the given array type and length.
      Type Parameters:
        `T` - the type of the array elements
      Parameters:
        `type` - the type of the array to allocate
        `length` - the length of the array to allocate
      Returns:
        the new allocated array
      Throws:
        `NullPointerException` - if the type is `null`
        `OutOfMemoryError` - if the array could not be allocated