sys::Obj sys::Sys
public class Sys
Sys provides access to the system environment.
public static inline App app
The application instance for the VM
public static long bootTime
The time in nanosecond ticks the Sedona runtime was booted
public static const Kit[] kits
The list of kits installed in this environment.
public static const define int kitsLen
The number of items in the kits array.
public static inline byte[] logLevels
The current severity level of each log
public static const Log[] logs
The list of logs installed in this environment.
public static const define int logsLen
The number of items in the logs array.
public static const define int maxInt
Max value of a 32-bit signed integer: 2,147,483,647
public static const define long maxLong
Max value of a 64-bit signed integer: 9,223,372,036,854,775,807
public static const define int minInt
Min value of a 32-bit signed integer: -2,147,483,648
public static const define long minLong
Min value of a 64-bit signed integer: -9,223,372,036,854,775,808
public static inline InStream nullIn
The null input stream is always at end of file.
public static inline OutStream nullOut
The null output stream sinks its output to nowhere.
public static inline OutStream out
Standard output stream.
public static const define int sizeofRef
Size in bytes of a reference/pointer on this system.
public static native void andBytes(int mask, byte[] bytes, int off, int len)
Perform a bitwise "and" using the specified mask on each byte in the bytes array.
public static native double bitsToDouble(long bits)
Return a 64-bit floating point value according to the IEEE 754 floating-point "double format" bit layout.
public static native float bitsToFloat(int bits)
Return a 32-bit floating point value according to the IEEE 754 floating-point "single format" bit layout.
public static native int compareBytes(byte[] a, int aOff, byte[] b, int bOff, int len)
Compare two byte arrays for equality. If equal return 0, if a is less than b return -1, if a greater than b return 1.
public static native void copy(byte[] src, int srcOff, byte[] dest, int destOff, int num)
Copy num bytes from the source byte array to the destination byte array. The arrays may be overlapping (like memmove, not memcpy).
public static native Str doubleStr(double v)
Format a double into a string. The string is stored in a static shared buffer.
public static native long doubleToBits(double v)
Return a long representation of a 64-bit floating point value according to the IEEE 754 floating-point "double format" bit layout.
public static Kit findKit(Str name)
Find a kit by its unique name or return null if not found.
public static Log findLog(Str qname)
Find a log by its qualified name or return null if not found.
public static Type findType(Str qname)
Find a type by its qualified name such as "sys::Component" or return null if not found.
public static native Str floatStr(float v)
Format a float into a string. The string is stored in a static shared buffer.
public static native int floatToBits(float v)
Return an integer representation of a 32-bit floating point value according to the IEEE 754 floating-point "single format" bit layout.
public static int fromDigit(int digit)
Return the numeric value of a decimal character:
'0' -> 0 '9' -> 9
Return -1 if not a valid decimal digit.
public static int fromHexDigit(int digit)
Return the numeric value of an decimal character:
'0' -> 0 '9' -> 9 'a' or 'A' -> 10 'f' or 'F' -> 15
Return -1 if not a valid hex digit.
public static native Str hexStr(int v)
Format an integer as a hexadecimal string. The string is stored in a static shared buffer.
public static native Str intStr(int v)
Format an integer as a decimal string. The string is stored in a static shared buffer.
public static Kit kit(int id)
Get the kit for the specified id or return null if out of range.
public static Log log(int id)
Get the log for the specified id or return null if out of range.
public static native Str longHexStr(long v)
Format the 64-bit integer into a hexidecimal string. The string is stored in a static shared buffer.
public static native Str longStr(long v)
Format the 64-bit integer into a string. The string is stored in a static shared buffer.
public static int main(Str[] args, int argsLen)
Standard main entry point.
public static int max(int a, int b)
Return the max of two ints.
public static int min(int a, int b)
Return the min of two ints.
public static native void orBytes(int mask, byte[] bytes, int off, int len)
Perform a bitwise "or" using the specified mask on each byte in the bytes array.
public static void printVer(OutStream out)
Print version information to the output stream.
public static native int rand()
Generate a random 32-bit integer.
public static int resume(Str[] args, int argsLen)
This is the entry point where native code resumes the Sedona VM from a yield or hibernate state. VM heap remains intact.
public static native byte[] scodeAddr()
Get the base address of the scode image as a byte pointer. INTERNAL USE ONLY.
public static native void setBytes(int val, byte[] bytes, int off, int len)
Set all the bytes in the specified array to val.
public static int shutdown(int result)
This method unwinds the Sedona call stack and the VM exits with the given error code.
If it returns 'Err.hibernate' or 'Err.yield', the Sedona heap remains intact and can be restarted via 'resume' entry point
If the specified result is not the hibernate or yield error codes, then stop the application and cleanup memory.
public static native void sleep(long t)
Sleep for the specified time in nanosecond ticks. If t <= 0, then sleep should return immediately.
This method is for use by App and test code only. Do not call from within Component execute() or Service work() methods.
public static native long ticks()
Get the current time as a 64-bit integer of nanosecond ticks. Ticks are not necessarily based on wall-time, but rather based on an arbitrary epoch (typically the boot time of the host)
public static Type type(int kitId, int typeId)
Get the type for the specified kit and type id or return null if out of range.