DthingApi
Static Public Member Functions | Static Public Attributes | List of all members
java.lang.System Class Reference

Static Public Member Functions

static native void arraycopy (Object src, int srcPos, Object dst, int dstPos, int length)
 
static native long currentTimeMillis ()
 
static void exit (int code)
 
static void gc ()
 
static String getProperty (String propertyName)
 
static native String getProperty (String prop, String defaultValue)
 
static native int identityHashCode (Object anObject)
 

Static Public Attributes

static final InputStream in
 
static final PrintStream out
 
static final PrintStream err
 

Detailed Description

Provides access to system-related information and resources including standard input and output. Enables clients to dynamically load native libraries. All methods of this class are accessed in a static way and the class itself can not be instantiated.

See also
Runtime

Member Function Documentation

◆ arraycopy()

static native void java.lang.System.arraycopy ( Object  src,
int  srcPos,
Object  dst,
int  dstPos,
int  length 
)
static

Copies

length

elements from the array

src

, starting at offset

srcPos

, into the array

dst

, starting at offset

dstPos

.

Parameters
srcthe source array to copy the content.
srcPosthe starting index of the content in
src
.
dstthe destination array to copy the data into.
dstPosthe starting index for the copied content in
dst
.
lengththe number of elements to be copied.

◆ currentTimeMillis()

static native long java.lang.System.currentTimeMillis ( )
static

Returns the current system time in milliseconds since January 1, 1970 00:00:00 UTC. This method shouldn't be used for measuring timeouts or other elapsed time measurements, as changing the system time can affect the results.

Returns
the local system time in milliseconds.

◆ exit()

static void java.lang.System.exit ( int  code)
inlinestatic

Causes the VM to stop running and the program to exit. If runFinalizersOnExit(boolean) has been previously invoked with a

true

argument, then all objects will be properly garbage-collected and finalized first.

Parameters
codethe return code.

◆ gc()

static void java.lang.System.gc ( )
inlinestatic

Indicates to the VM that it would be a good time to run the garbage collector. Note that this is a hint only. There is no guarantee that the garbage collector will actually be run.

◆ getProperty() [1/2]

static String java.lang.System.getProperty ( String  propertyName)
inlinestatic

Returns the value of a particular system property or

null

if no such property exists.

The following properties are always provided by the Dalvik VM:

Name Meaning Example
file.separator java.io.File#separator
/

java.class.path System class path
.
java.class.version (Not useful on Android)
50.0
java.compiler (Not useful on Android) Empty
java.ext.dirs (Not useful on Android) Empty
java.home Location of the VM on the file system
/system
java.io.tmpdir See java.io.File#createTempFile
/sdcard
java.library.path Search path for JNI libraries
/system/lib
java.vendor Human-readable VM vendor
The Android Project
java.vendor.url URL for VM vendor's web site
http://www.android.com/
java.version (Not useful on Android)
0

java.specification.version VM libraries version
0.9
java.specification.vendor VM libraries vendor
The Android Project
java.specification.name VM libraries name
Dalvik Core Library
java.vm.version VM implementation version
1.2.0
java.vm.vendor VM implementation vendor
The Android Project
java.vm.name VM implementation name
Dalvik
java.vm.specification.version VM specification version
0.9
java.vm.specification.vendor VM specification vendor
The Android Project
java.vm.specification.name VM specification name
Dalvik Virtual Machine Specification

line.separator The system line separator
\n

os.arch OS architecture
armv7l
os.name OS (kernel) name
Linux
os.version OS (kernel) version
2.6.32.9-g103d848

path.separator See java.io.File#pathSeparator
:

user.dir Base of non-absolute paths
/
user.home (Not useful on Android) Empty
user.name (Not useful on Android)

Empty

It is a mistake to try to override any of these. Doing so will have unpredictable results.

Parameters
propertyNamethe name of the system property to look up.
Returns
the value of the specified system property or
null
if the property doesn't exist.

◆ getProperty() [2/2]

static native String java.lang.System.getProperty ( String  prop,
String  defaultValue 
)
static

Returns the value of a particular system property. The

defaultValue

will be returned if no such property has been found.

Parameters
propthe name of the system property to look up.
defaultValuethe return value if the system property with the given name does not exist.
Returns
the value of the specified system property or the
defaultValue
if the property does not exist.

◆ identityHashCode()

static native int java.lang.System.identityHashCode ( Object  anObject)
static

Returns an integer hash code for the parameter. The hash code returned is the same one that would be returned by the method

, whether or not the object's class has overridden hashCode(). The hash code for

null

is

0

.

Parameters
anObjectthe object to calculate the hash code.
Returns
the hash code for the given object.
See also
java.lang.Object::hashCode

Member Data Documentation

◆ err

final PrintStream java.lang.System.err
static

Default error output stream.

◆ in

final InputStream java.lang.System.in
static

Default input stream.

◆ out

final PrintStream java.lang.System.out
static

Default output stream.


The documentation for this class was generated from the following file: