public class UtilityFunctions extends Object
MethodRegisterUtility#registerFunctions(MethodRegistry) and that function
registers the methods in this class with their own name so that BASIC
programs can call the functions like BASIC built in functions.| Modifier and Type | Method and Description |
|---|---|
static byte[] |
byteBuffer(int len)
Create a new byte buffer of length
len. |
static Long |
getByte(byte[] buffer,
Long i) |
static byte[] |
getStringBytes(String s) |
static Boolean |
isDefined(Object s) |
static Boolean |
isUndef(Object s) |
static Long |
length(Object arg) |
static Object |
newObject(String klass)
This method can be used to call the default (parameter less) constructor
of a class.
|
static void |
setByte(byte[] buffer,
Long i,
Long v) |
static String |
stringifyBuffer(byte[] buffer) |
static Object |
undef()
This function returns the undef value.
|
public static Object newObject(String klass) throws ClassNotFoundException, InstantiationException, IllegalAccessException
klass - the class to instantiateClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionpublic static Object undef()
public static Boolean isUndef(Object s)
s - public static Boolean isDefined(Object s)
s - public static byte[] byteBuffer(int len)
len.len - the length of the buffer allocated.public static void setByte(byte[] buffer,
Long i,
Long v)
throws BasicRuntimeException
BasicRuntimeExceptionpublic static byte[] getStringBytes(String s) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static String stringifyBuffer(byte[] buffer) throws UnsupportedEncodingException
UnsupportedEncodingExceptionCopyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.