java.lang
Class System

java.lang.Object
  extended byjava.lang.System

public final class System
extends Object

This class is as close to the java.lang.System class as is possible. However no references to any classes in "java." packages other than "java.lang" are not possible. This means all the methods that deal with IO streams are not available.

Most of these method simply pass the call to corresponding ones in ewe.sys.Vm.

If you are looking for System.out and System.in, use Vm.out and Vm.in instead.


Constructor Summary
System()
           
 
Method Summary
static void arraycopy(Object src, int src_position, Object dest, int dest_position, int length)
          Copy from one array to another.
static long currentTimeMillis()
          Get the current time in milliseconds.
static void exit(int exitCode)
          Tell the VM to exit with the specified exit code.
static void gc()
          Tell the VM to do a garbage collection run.
static String getProperty(String name)
          Get a system property.
static String getProperty(String name, String defaultValue)
          Get a system property.
static SecurityManager getSecurityManager()
          Get the current SecurityManager if one is set.
static int identityHashCode(Object obj)
          Get what the hashcode of this Object would be if the Object.hashCode() method was called instead of any overriding hashCode() methods.
static void load(String libraryName)
          Load a library name using the absolute path name.
static void loadLibrary(String libraryName)
          Load a library name, not using the system default library extension.
static void runFinalization()
          Under a Ewe VM this will simply do a gc().
static void runFinalizationOnExit(boolean on)
          Tells the VM to run finalizers on exit.
static String setProperty(String key, String value)
          Set a property value.
static void setSecurityManager(SecurityManager sm)
          Set the SecurityManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Constructor Detail

System

public System()
Method Detail

arraycopy

public static void arraycopy(Object src,
                             int src_position,
                             Object dest,
                             int dest_position,
                             int length)
Copy from one array to another.


currentTimeMillis

public static long currentTimeMillis()
Get the current time in milliseconds.


exit

public static void exit(int exitCode)
Tell the VM to exit with the specified exit code.


gc

public static void gc()
Tell the VM to do a garbage collection run.


getProperty

public static String getProperty(String name)
Get a system property.

Parameters:
name - The name of the property.
Returns:
The value of the property or null if it is not set.

getProperty

public static String getProperty(String name,
                                 String defaultValue)
Get a system property.

Parameters:
name - The name of the property.
defaultValue - the default value to return if the property is not set.
Returns:
The value of the property or the defaultValue if it is not set.

getSecurityManager

public static SecurityManager getSecurityManager()
Get the current SecurityManager if one is set.

Returns:
the current SecurityManager if one is set, or null if not.

setSecurityManager

public static void setSecurityManager(SecurityManager sm)
                               throws SecurityException
Set the SecurityManager. Under Ewe version 1.30 the SecurityManager does nothing. Future versions will have this security enabled.

Parameters:
sm - The SecurityManager.
Throws:
SecurityException - if a SecurityManager is already set.

loadLibrary

public static void loadLibrary(String libraryName)
                        throws UnsatisfiedLinkError,
                               SecurityException
Load a library name, not using the system default library extension.

Parameters:
libraryName - The name of the library.
Throws:
UnsatisfiedLinkError - If the library could not be loaded or is invalid.
SecurityException - If library loading is not allowed.

load

public static void load(String libraryName)
                 throws UnsatisfiedLinkError,
                        SecurityException
Load a library name using the absolute path name.

Parameters:
libraryName - The name and path of the library.
Throws:
UnsatisfiedLinkError - If the library could not be loaded or is invalid.
SecurityException - If library loading is not allowed.

runFinalization

public static void runFinalization()
Under a Ewe VM this will simply do a gc(). Under a Java VM this will run finalizations on pending classes.


runFinalizationOnExit

public static void runFinalizationOnExit(boolean on)
Tells the VM to run finalizers on exit. Under Ewe this does nothing.


identityHashCode

public static int identityHashCode(Object obj)
Get what the hashcode of this Object would be if the Object.hashCode() method was called instead of any overriding hashCode() methods.


setProperty

public static String setProperty(String key,
                                 String value)
Set a property value.

Parameters:
key - The property name.
value - The property value.
Returns:
the old property value (if any).