jif.runtime

## Class Runtime

- java.lang.Object
- - jif.runtime.Runtime

-     public class Runtime
      extends java.lang.Object

  The runtime interface between Jif programs and the underlying system.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.Object[]` | `arrayDeepClone(java.lang.Object[] a)`
    `static int` | `currentDayOfMonth(Principal dummy)`
    `static int` | `currentHour(Principal dummy)`
    `static int` | `currentMinute(Principal dummy)`
    `static int` | `currentMonth(Principal dummy)`
    `static java.lang.String` | `currentUser()`
    `static int` | `currentYear(Principal dummy)`
    `java.io.PrintStream` | `err()` Get the standard error output parameterized by the default label, which has only one reader: the principal of this `Runtime` object.
    `static Runtime` | `getRuntime(Principal p)` Gets a `Runtime` object parameterized with the principal `p`.
    `static Principal` | `getUser(Principal parameter, java.lang.String username)` Get a native user
    `java.io.InputStream` | `in()` Get the standard input parameterized by the default label, which has only one reader: the principal of this `Runtime` object.
    `static void` | `loadRuntimeLibrary()`
    `java.io.FileInputStream` | `openFileRead(java.lang.String name, Label L)` Opens a file input stream for reading from the file with the specific `name`.
    `java.io.FileOutputStream` | `openFileWrite(java.lang.String name, boolean append, Label L)` Opens a file output stream to write a file with the specific `name`.
    `java.io.PrintStream` | `out()` Get the standard output parameterized by the default label, which has only one reader: the principal of this `Runtime` object.
    `static void` | `sleep(Principal dummy, int s)`
    `java.io.PrintStream` | `stderr(Label l)` Gets the standard error output.
    `java.io.InputStream` | `stdin(Label l)` Gets the standard input.
    `java.io.PrintStream` | `stdout(Label l)` Gets the standard output.
    `static Principal` | `user(Principal parameter)` Get the current user

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

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

- - ### Method Detail

    - #### getRuntime

          public static Runtime getRuntime(Principal p)
                                    throws java.lang.SecurityException

      Gets a `Runtime` object parameterized with the principal `p`.
      Throws:
        `java.lang.SecurityException`

    - #### user

          public static Principal user(Principal parameter)

      Get the current user

    - #### getUser

          public static Principal getUser(Principal parameter,
                                          java.lang.String username)

      Get a native user

    - #### openFileWrite

          public java.io.FileOutputStream openFileWrite(java.lang.String name,
                                                        boolean append,
                                                        Label L)
                                                 throws java.io.IOException,
                                                        java.lang.SecurityException

      Opens a file output stream to write a file with the specific `name`.
      Parameters:
        `name` - the file name
        `append` - if true, then bytes will be written to the end of the file rather than the beginning
        `L` - the label parameter of the resulting `FileOutputStream`
      Throws:
        `java.io.FileNotFoundException` - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason.
        `java.lang.SecurityException` - if `l` is unable to relabel to the Jif label derived from the ACL of the file.
        `java.io.IOException`

    - #### openFileRead

          public java.io.FileInputStream openFileRead(java.lang.String name,
                                                      Label L)
                                               throws java.io.FileNotFoundException,
                                                      java.lang.SecurityException

      Opens a file input stream for reading from the file with the specific `name`.
      Parameters:
        `name` - the file name
        `L` - the the label parameter of the resulting `FileInputStream`
      Throws:
        `java.lang.SecurityException` - if `l` is less restrictive than the Jif label derived from the ACL of the file.
        `java.io.FileNotFoundException`

    - #### stderr

          public java.io.PrintStream stderr(Label l)

      Gets the standard error output. The output channel is parameterized by `l`.

    - #### stdout

          public java.io.PrintStream stdout(Label l)

      Gets the standard output. This output channel is parameterized by `l`.

    - #### stdin

          public java.io.InputStream stdin(Label l)

      Gets the standard input. This input channel is parameterized by `l`.

    - #### out

          public java.io.PrintStream out()

      Get the standard output parameterized by the default label, which has only one reader: the principal of this `Runtime` object.

    - #### in

          public java.io.InputStream in()

      Get the standard input parameterized by the default label, which has only one reader: the principal of this `Runtime` object.

    - #### err

          public java.io.PrintStream err()

      Get the standard error output parameterized by the default label, which has only one reader: the principal of this `Runtime` object.

    - #### currentUser

          public static java.lang.String currentUser()

    - #### currentYear

          public static int currentYear(Principal dummy)

    - #### currentMonth

          public static int currentMonth(Principal dummy)

    - #### currentDayOfMonth

          public static int currentDayOfMonth(Principal dummy)

    - #### currentHour

          public static int currentHour(Principal dummy)

    - #### currentMinute

          public static int currentMinute(Principal dummy)

    - #### sleep

          public static void sleep(Principal dummy,
                                   int s)

    - #### arrayDeepClone

          public static java.lang.Object[] arrayDeepClone(java.lang.Object[] a)

    - #### loadRuntimeLibrary

          public static void loadRuntimeLibrary()