1 |
/* VMSystem.java |
/* VMSystem.java -- helper for java.lang.system |
2 |
Copyright (C) 1998 Free Software Foundation |
Copyright (C) 1998, 2002 Free Software Foundation |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
6 |
GNU Classpath is free software; you can redistribute it and/or modify |
GNU Classpath is free software; you can redistribute it and/or modify |
40 |
import java.util.Properties; |
import java.util.Properties; |
41 |
|
|
42 |
/** |
/** |
43 |
** VMSystem is a package-private helper class for System that the |
* VMSystem is a package-private helper class for System that the |
44 |
** VM must implement. |
* VM must implement. |
45 |
** |
* |
46 |
** @author John Keiser |
* @author John Keiser |
47 |
** @version 1.1.0, Aug 8 1998 |
*/ |
48 |
**/ |
final class VMSystem |
49 |
|
{ |
50 |
class VMSystem { |
/** |
51 |
/** Get the system properties. |
* Get the system properties. These MUST include: |
52 |
** <dl> |
* <dl> |
53 |
** <dt>java.version <dd>Java version number |
* <dt>java.version <dd>Java version number |
54 |
** <dt>java.vendor <dd>Java vendor specific string |
* <dt>java.vendor <dd>Java vendor specific string |
55 |
** <dt>java.vendor.url <dd>Java vendor URL |
* <dt>java.vendor.url <dd>Java vendor URL |
56 |
** <dt>java.home <dd>Java installation directory |
* <dt>java.home <dd>Java installation directory |
57 |
** <dt>java.class.version <dd>Java class version number |
* <dt>java.vm.specification.version <dd>VM Spec version |
58 |
** <dt>java.class.path <dd>Java classpath |
* <dt>java.vm.specification.vendor <dd>VM Spec vendor |
59 |
** <dt>os.name <dd>Operating System Name |
* <dt>java.vm.specification.name <dd>VM Spec name |
60 |
** <dt>os.arch <dd>Operating System Architecture |
* <dt>java.vm.version <dd>VM implementation version |
61 |
** <dt>os.version <dd>Operating System Version |
* <dt>java.vm.vendor <dd>VM implementation vendor |
62 |
** <dt>file.separator <dd>File separator ("/" on Unix) |
* <dt>java.vm.name <dd>VM implementation name |
63 |
** <dt>path.separator <dd>Path separator (":" on Unix) |
* <dt>java.specification.version <dd>Java Runtime Environment version |
64 |
** <dt>line.separator <dd>Line separator ("\n" on Unix) |
* <dt>java.specification.vendor <dd>Java Runtime Environment vendor |
65 |
** <dt>user.name <dd>User account name |
* <dt>java.specification.name <dd>Java Runtime Environment name |
66 |
** <dt>user.home <dd>User home directory |
* <dt>java.class.version <dd>Java class version number |
67 |
** <dt>user.dir <dd>User's current working directory |
* <dt>java.class.path <dd>Java classpath |
68 |
** </dl> |
* <dt>java.library.path <dd>Path for finding Java libraries |
69 |
** It will also define the java.compiler if env(JAVA_COMPILER) is defined.<P> |
* <dt>java.io.tmpdir <dd>Default temp file path |
70 |
** |
* <dt>java.compiler <dd>Name of JIT to use |
71 |
** <STRONG>Copyright Note:</STRONG> The above text was taken from |
* <dt>java.ext.dirs <dd>Java extension path |
72 |
** Japhar, by the Hungry Programmers (http://www.japhar.org). |
* <dt>os.name <dd>Operating System Name |
73 |
** |
* <dt>os.arch <dd>Operating System Architecture |
74 |
** @param p the Properties object to insert the system |
* <dt>os.version <dd>Operating System Version |
75 |
** properties into. |
* <dt>file.separator <dd>File separator ("/" on Unix) |
76 |
**/ |
* <dt>path.separator <dd>Path separator (":" on Unix) |
77 |
static native void insertSystemProperties(Properties p); |
* <dt>line.separator <dd>Line separator ("\n" on Unix) |
78 |
|
* <dt>user.name <dd>User account name |
79 |
/** Copy one array onto another from |
* <dt>user.home <dd>User home directory |
80 |
** <CODE>src[srcStart] ... src[srcStart+len]</CODE> to |
* <dt>user.dir <dd>User's current working directory |
81 |
** <CODE>dest[destStart] ... dest[destStart+len]</CODE> |
* </dl> |
82 |
** @param src the array to copy elements from |
* |
83 |
** @param srcStart the starting position to copy elements |
* @param p the Properties object to insert the system properties into |
84 |
** from in the src array |
*/ |
85 |
** @param dest the array to copy elements to |
static native void insertSystemProperties(Properties p); |
86 |
** @param destStart the starting position to copy |
|
87 |
** elements from in the src array |
/** |
88 |
** @param len the number of elements to copy |
* Copy one array onto another from <code>src[srcStart]</code> ... |
89 |
** @exception ArrayStoreException if src or dest is not |
* <code>src[srcStart+len-1]</code> to <code>dest[destStart]</code> ... |
90 |
** an array, or if one is a primitive type |
* <code>dest[destStart+len-1]</code>. First, the arguments are validated: |
91 |
** and the other is a reference type or a |
* neither array may be null, they must be of compatible types, and the |
92 |
** different primitive type. The array will |
* start and length must fit within both arrays. Then the copying starts, |
93 |
** not be modified if any of these is th |
* and proceeds through increasing slots. If src and dest are the same |
94 |
** case. If there is an element in src that |
* array, this will appear to copy the data to a temporary location first. |
95 |
** is not assignable to dest's type, this will |
* An ArrayStoreException in the middle of copying will leave earlier |
96 |
** be thrown and all elements up to but not |
* elements copied, but later elements unchanged. |
97 |
** including that element will have been |
* |
98 |
** modified. |
* @param src the array to copy elements from |
99 |
** @exception ArrayIndexOutOfBoundsException if len is |
* @param srcStart the starting position in src |
100 |
** negative, or if the start or end copy |
* @param dest the array to copy elements to |
101 |
** position in either array is out of bounds. |
* @param destStart the starting position in dest |
102 |
** The array will not be modified if this |
* @param len the number of elements to copy |
103 |
** exception is thrown. |
* @throws NullPointerException if src or dest is null |
104 |
**/ |
* @throws ArrayStoreException if src or dest is not an array, if they are |
105 |
static native void arraycopy(Object src, int srcStart, Object dest, int destStart, int len); |
* not compatible array types, or if an incompatible runtime type |
106 |
|
* is stored in dest |
107 |
/** Get a hash code computed by the VM for the Object. |
* @throws IndexOutOfBoundsException if len is negative, or if the start or |
108 |
** This hash code will be the same as Object's hashCode() |
* end copy position in either array is out of bounds |
109 |
** method. It is usually some convolution of the pointer |
*/ |
110 |
** to the Object internal to the VM. It follows standard |
static native void arraycopy(Object src, int srcStart, |
111 |
** hash code rules, in that it will remain the same for a |
Object dest, int destStart, int len); |
112 |
** given Object for the lifetime of that Object. |
|
113 |
** @param o the Object to get the hash code for |
/** |
114 |
** @return the VM-dependent hash code for this Object |
* Get a hash code computed by the VM for the Object. This hash code will |
115 |
**/ |
* be the same as Object's hashCode() method. It is usually some |
116 |
static native int identityHashCode(Object o); |
* convolution of the pointer to the Object internal to the VM. It |
117 |
|
* follows standard hash code rules, in that it will remain the same for a |
118 |
|
* given Object for the lifetime of that Object. |
119 |
|
* |
120 |
|
* @param o the Object to get the hash code for |
121 |
|
* @return the VM-dependent hash code for this Object |
122 |
|
*/ |
123 |
|
static native int identityHashCode(Object o); |
124 |
|
|
125 |
|
/** |
126 |
|
* Convert a library name to its platform-specific variant. |
127 |
|
* |
128 |
|
* @param libname the library name, as used in <code>loadLibrary</code> |
129 |
|
* @return the platform-specific mangling of the name |
130 |
|
* @XXX Add this method |
131 |
|
static native String mapLibraryName(String libname); |
132 |
|
*/ |
133 |
} |
} |