/*
 * Copyright 2011-2023 MicroEJ Corp. All rights reserved.
 * This library is provided in source code for use, modification and test, subject to license terms.
 * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
 */
package ej.bon;

import java.util.Date;

/**
 * This class offers basic services for B-ON implementation.
 */
public class Util {

    /**
     * Gets the application time in milliseconds.
     * <p>
     * The result of this method is the same as the
     * {@link System#currentTimeMillis()} method one.
     *
     * @return the application time in milliseconds
     */
    public static long currentTimeMillis() {
        throw new RuntimeException();
    }

    /**
     * Gets an arbitrary time in milliseconds.
     * <p>
     * Only elapsed time between two calls is meaningful.
     *
     * @return the platform time in milliseconds
     */
    public static long platformTimeMillis() {
        throw new RuntimeException();
    }

    /**
     * Gets an arbitrary time in nanoseconds.
     * <p>
     * Only elapsed time between two calls is meaningful.
     *
     * @return the platform time in nanoseconds
     */
    public static long platformTimeNanos() {
        throw new RuntimeException();
    }

    /**
     * Sets the application time.
     * <p>
     * This time does not change the platform time.
     *
     * @param t
     *            the application time to set in milliseconds
     *
     * @throws IllegalArgumentException
     *             if <code>t</code> is negative
     */
    public static void setCurrentTimeMillis(long t) {
        throw new RuntimeException();
    }

    /**
     * Sets the application time.
     * <p>
     * This time does not change the platform time. The
     * <code>Util.setCurrentTimeMillis(d)</code> method has the same effect as
     * <code>Util.setCurrentTimeMillis(d.getTime())</code>.
     *
     * @param d
     *            the application time to set
     */
    public static void setCurrentTimeMillis(Date d) {
        throw new RuntimeException();
    }

    /**
     * Allocates a new array of object references from the given array type and
     * length.
     *
     * @param type
     *            the type of the array to allocate
     * @param length
     *            the length of the array to allocate
     * @param <T>
     *            the type of the array elements
     * @return the new allocated array
     * @throws NullPointerException
     *             if the type is <code>null</code>
     * @throws OutOfMemoryError
     *             if the array could not be allocated
     */
    public static <T> T[] newArray(Class<T[]> type, int length) {
        throw new RuntimeException();
    }
}
