java.lang
Class Runtime

java.lang.Object
  extended by java.lang.Runtime

public class Runtime
extends Object

Minimalist version of the standard Java Runtime class.

Author:
Paul Andrews

Method Summary
 void addShutdownHook(Thread hook)
          Add a shutdown hook.
 void exit(int code)
          Terminate the application.
 long freeMemory()
          Return the amount of free memory.on the heap
static Runtime getRuntime()
          Get the single instance of us.
 void halt(int code)
          Terminate the application immediately
 boolean removeShutdownHook(Thread hook)
          Remove a previously installed shutdown hook from the system.
 long totalMemory()
          Return the size of the heap in bytes.
 
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()
Get the single instance of us.


freeMemory

public long freeMemory()
Return the amount of free memory.on the heap

Returns:
the free memory in bytes

totalMemory

public long totalMemory()
Return the size of the heap in bytes.

Returns:
the free memory in bytes

exit

public void exit(int code)
Terminate the application.


halt

public void halt(int code)
Terminate the application immediately


addShutdownHook

public void addShutdownHook(Thread hook)
Add a shutdown hook. Shutdown hooks are run just before the VM terminates.

Parameters:
hook -

removeShutdownHook

public boolean removeShutdownHook(Thread hook)
Remove a previously installed shutdown hook from the system.

Parameters:
hook -
Returns:
true if the hook was removed false if not