public final class System extends Object
Modifier and Type | Field and Description |
---|---|
static PrintStream |
err |
static InputStream |
in |
static PrintStream |
out |
Constructor and Description |
---|
System() |
Modifier and Type | Method and Description |
---|---|
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) |
static void |
gc()
Tell the VM to do a garbage collection run.
|
static String |
getenv(String name)
Search for an environment variable value.
|
static Properties |
getProperties() |
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 in a system dependant way (don't use an extension with the library name).
|
static String |
mapLibraryName(String libName) |
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.
|
public static PrintStream out
public static PrintStream err
public static InputStream in
public static void arraycopy(Object src, int src_position, Object dest, int dest_position, int length)
public static long currentTimeMillis()
public static void exit(int exitCode)
public static void gc()
public static String getProperty(String name)
name
- The name of the property.public static String getProperty(String name, String defaultValue)
name
- The name of the property.defaultValue
- the default value to return if the property is not set.public static String setProperty(String key, String value)
key
- The property name.value
- The property value.public static Properties getProperties()
public static SecurityManager getSecurityManager()
public static void setSecurityManager(SecurityManager sm) throws SecurityException
sm
- The SecurityManager.SecurityException
- if a SecurityManager is already set.public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException
libraryName
- The name of the library.UnsatisfiedLinkError
- If the library could not be loaded or is invalid.SecurityException
- If library loading is not allowed.public static void load(String libraryName) throws UnsatisfiedLinkError, SecurityException
libraryName
- The name and path of the library.UnsatisfiedLinkError
- If the library could not be loaded or is invalid.SecurityException
- If library loading is not allowed.public static void runFinalization()
public static void runFinalizationOnExit(boolean on)
public static int identityHashCode(Object obj)