|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpnuts.lang.Runtime
public class Runtime
This class provides runtime supports for Pnuts compiler/interpreter. Most of the methods are protected static, so that only subclasses can access them.
Nested Class Summary | |
---|---|
protected static class |
Runtime.Accessor
|
static class |
Runtime.Break
|
static class |
Runtime.Continue
|
static interface |
Runtime.FunctionSerializer
|
protected static class |
Runtime.TypeMap
|
Field Summary | |
---|---|
protected static java.lang.String |
BOOLEAN_SYMBOL
|
protected static java.lang.String |
BYTE_SYMBOL
|
protected static java.lang.String |
CHAR_SYMBOL
|
protected static java.lang.String |
CLONE
|
protected static java.lang.String |
DOUBLE_SYMBOL
|
protected static java.lang.String |
EXCEPTOIN_FIELD_SYMBOL
|
protected static java.lang.String |
FLOAT_SYMBOL
|
protected static java.lang.String |
INT_SYMBOL
|
protected static java.lang.String |
LONG_SYMBOL
|
protected static java.lang.String |
SHORT_SYMBOL
|
protected static java.lang.String |
VOID_SYMBOL
|
Constructor Summary | |
---|---|
protected |
Runtime()
|
Method Summary | |
---|---|
protected java.lang.Object |
_callConstructor(Context context,
java.lang.Class c,
java.lang.Object[] args,
java.lang.Class[] types)
Call a constructor |
protected java.lang.Object |
_callMethod(Context context,
java.lang.Class c,
java.lang.String name,
java.lang.Object[] args,
java.lang.Class[] types,
java.lang.Object target)
Call a method |
static java.lang.Object |
add(java.lang.Object n1,
java.lang.Object n2)
+ operation |
protected static java.lang.Object |
add(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Object |
add1(java.lang.Object n)
Add 1 to an object (integer) |
protected static java.lang.Object |
add1(java.lang.Object n,
Context context)
|
static void |
addImport(Context context,
java.lang.String name)
|
static void |
addStaticMembers(Context context,
java.lang.String name,
boolean wildcard)
|
static java.lang.Object |
and(java.lang.Object n1,
java.lang.Object n2)
& operation |
protected static java.lang.Object |
and(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Object |
applyGenerator(Generator g,
PnutsFunction closure,
Context context)
|
protected static int |
arraydim(java.lang.Object o)
|
static java.lang.Class |
arrayType(java.lang.Class c,
int dim)
Creates an array type |
static java.lang.Object |
call(Context context,
java.lang.Object target,
java.lang.Object[] args,
java.lang.Class[] casts)
This method is called by the syntax "funcOrClass(args...)" |
static java.lang.Object |
call(Context context,
java.lang.Object target,
java.lang.Object[] args,
java.lang.Class[] casts,
int line,
int column)
|
static java.lang.Object |
callConstructor(Context context,
java.lang.Class c,
java.lang.Object[] args,
java.lang.Class[] types)
Call a constructor |
protected static java.lang.Object |
callFunction(Context context,
PnutsFunction func,
java.lang.Object[] args)
Call a function |
static java.lang.Object |
callMethod(Context context,
java.lang.Class c,
java.lang.String name,
java.lang.Object[] args,
java.lang.Class[] types,
java.lang.Object target)
Call a method |
static java.lang.Object |
cast(Context context,
java.lang.Class type,
java.lang.Object object,
boolean flag)
This method is called by the syntax "(Class)object" |
protected static void |
catchException(java.lang.Class type,
PnutsFunction func,
Context context)
This method is called when catch() function is called in a package(non-local) scope |
protected static void |
checkException(Context context,
java.lang.Throwable throwable)
|
protected static void |
checkException(Context context,
java.lang.Throwable throwable,
Runtime.TypeMap tmap)
Check if any exception handler is registered to the specified exception. |
static int |
compareObjects(java.lang.Object e1,
java.lang.Object e2)
Compare two objects Elements of List and array are recursively compared. |
static int |
compareTo(java.lang.Object n1,
java.lang.Object n2)
Compares n1 with n2 |
protected static int |
compareTo(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
protected static java.util.List |
createList(Context context)
|
protected static java.util.Map |
createMap(int size,
Context context)
|
protected static PnutsFunction |
defineTopLevelFunction(Function f,
java.lang.String symbol,
Package pkg,
Context context)
|
protected static PnutsFunction |
defineUnboundFunction(Function f,
java.lang.String symbol,
Package pkg)
|
static java.lang.Object |
divide(java.lang.Object n1,
java.lang.Object n2)
/ operation |
protected static java.lang.Object |
divide(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static boolean |
eq(java.lang.Object n1,
java.lang.Object n2)
== operation |
protected static boolean |
eq(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
protected static void |
escape(java.lang.Object v)
|
protected java.lang.Object |
exec(Context context)
This method is overrided by classes generated by the compiler. |
java.lang.Object |
execute(Context context)
Deprecated. replaced by run(Context) |
static java.net.URL |
fileToURL(java.io.File file)
Gets a URL from a File |
protected static java.lang.reflect.Method |
findCallableMethod(java.lang.Class clazz,
java.lang.String name,
java.lang.Class[] args)
|
static java.lang.String |
format(java.lang.Object object,
int maxArrayLength)
Get the String representation of the specified object. |
static java.lang.String |
format(java.lang.Object object,
int maxArrayLength,
int maxFormatSize)
|
static boolean |
ge(java.lang.Object n1,
java.lang.Object n2)
>= operation |
protected static boolean |
ge(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static int |
getArrayLength(java.lang.Object array)
Gets an array's length |
static java.lang.Object |
getBeanProperty(Context context,
java.lang.Object target,
java.lang.String name)
Gets a Bean property of the specified bean. |
java.lang.Object |
getBeanProperty(java.lang.Object target,
java.lang.String name)
Gets a Bean property of the specified bean. |
protected java.lang.Object |
getBeanProperty(java.lang.Object target,
java.lang.String name,
java.lang.Class stopClass)
Gets a Bean property of the specified bean. |
java.lang.Class |
getBeanPropertyType(java.lang.Class cls,
java.lang.String name)
Gets the type of a bean property |
protected static int |
getBeginColumn(Context context)
|
protected static int |
getBeginLine(Context context)
|
static java.lang.Class |
getBottomType(java.lang.Class clazz)
Get true component type from an array type. |
static Executable |
getCompiledScript(java.lang.String name,
Context context)
This method is called by Pnuts.load() when the property "pnuts.compiled.script.prefix" is defined, to load pre-compiled scripts. |
protected static java.lang.reflect.Constructor[] |
getConstructors(Context context,
java.lang.Class cls)
|
static java.lang.Object |
getElement(java.lang.Object target,
java.lang.Object key,
Context context)
This method is called by the syntax "target[key]" |
static java.lang.Object |
getElementAt(java.lang.Object target,
int idx,
Context context)
|
protected static int |
getEndLine(Context context)
|
protected static java.lang.reflect.Field |
getField(java.lang.Class cls,
java.lang.String name)
|
static java.lang.Object |
getField(Context context,
java.lang.Object target,
java.lang.String name)
Get the value of a instance field. |
protected static Function |
getFunction(Context context)
|
protected static Function |
getFunction(PnutsFunction pf,
int nargs)
|
protected static java.util.Enumeration |
getFunctions(PnutsFunction pf)
|
protected static java.lang.String |
getMessage(java.lang.String bundleName,
java.lang.String key,
java.lang.Object[] a)
|
protected static java.lang.reflect.Method[] |
getMethods(Context context,
java.lang.Class cls)
|
static java.lang.String |
getProperty(java.lang.String key)
|
static java.lang.Object |
getRange(java.lang.Object target,
java.lang.Object idx1,
java.lang.Object idx2,
Context context)
Range expression 'target[idx1..idx2]'. |
protected static Runtime |
getRuntime(Context context)
|
static java.io.Reader |
getScriptReader(java.io.InputStream in,
Context context)
Gets a Reader to read script files If context.getScriptEncoding() is non-null, it would be used as the encoding. |
protected static java.lang.Object |
getScriptSource(Context context)
|
static java.net.URL |
getScriptURL(java.lang.String name,
Context context)
Returns a URL of a script |
static java.lang.Object |
getStaticField(Context context,
java.lang.Class clazz,
java.lang.String name)
Get the value of a static field. |
static Context |
getThreadContext()
Sets the context bound to the current thread |
static boolean |
gt(java.lang.Object n1,
java.lang.Object n2)
> operation |
protected static boolean |
gt(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static boolean |
isArray(java.lang.Object obj)
Check if the parameter is an array |
static boolean |
isGenerator(SimpleNode node)
|
protected static void |
jump(java.lang.Object v)
|
static boolean |
le(java.lang.Object n1,
java.lang.Object n2)
<= operation |
protected static boolean |
le(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static SimpleNode |
loadNode(java.lang.String str)
|
static boolean |
lt(java.lang.Object n1,
java.lang.Object n2)
< operation |
protected static boolean |
lt(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
protected static java.lang.Object |
makeArray(java.lang.Object[] parameters,
Context context)
|
protected static int |
matchType(java.lang.Class type,
java.lang.Object obj)
|
static java.lang.Object |
mod(java.lang.Object n1,
java.lang.Object n2)
% operation |
protected static java.lang.Object |
mod(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Object |
multiply(java.lang.Object n1,
java.lang.Object n2)
* operation |
protected static java.lang.Object |
multiply(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static boolean |
ne(java.lang.Object n1,
java.lang.Object n2)
!= operation |
protected static boolean |
ne(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Object |
negate(java.lang.Object n)
Negates an number |
protected static java.lang.Object |
negate(java.lang.Object n,
Context context)
|
protected static java.lang.Object |
newInstance(Context context,
java.lang.Class c,
java.lang.Object[] args,
java.lang.Class[] casts)
|
static java.lang.Object |
not(java.lang.Object n)
|
protected static java.lang.Object |
not(java.lang.Object n,
Context context)
|
static java.lang.Object |
or(java.lang.Object n1,
java.lang.Object n2)
| operation |
protected static java.lang.Object |
or(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Character |
parseChar(java.lang.String str)
Parse a character literal. |
static java.lang.Object[] |
parseFloat(java.lang.String str)
Parse a floating point number. |
static java.lang.Object[] |
parseInt(java.lang.String str)
Parse an integer. |
static java.lang.String |
parseString(java.lang.String str)
Parse a string literal. |
static java.lang.Object |
primitive(Context context,
java.lang.Class primitiveType,
java.lang.Object param,
boolean flag)
This method is called by the syntax "primitiveType(object)" and "(primitiveType)object" |
static void |
printError(java.lang.Throwable t,
Context context)
|
static void |
putField(Context context,
java.lang.Object target,
java.lang.String name,
java.lang.Object expr)
Assign an object to a instance field. |
static void |
putStaticField(Context context,
java.lang.Class clazz,
java.lang.String name,
java.lang.Object expr)
Assign an object to a static field. |
static java.lang.Object |
quantity(java.lang.Number number,
java.lang.String numberString,
java.lang.String unit,
Context context)
Creates an object from a number literal and a unit symbol |
static java.lang.String |
replaceChar(java.lang.String str,
java.lang.Number n,
java.lang.Object expr)
|
java.lang.Object |
run(Context context)
Executes a compiled script. |
static java.lang.String |
saveNode(SimpleNode node)
|
static void |
setBeanProperty(Context context,
java.lang.Object target,
java.lang.String name,
java.lang.Object value)
Sets a Bean property of the specified bean. |
void |
setBeanProperty(java.lang.Object target,
java.lang.String name,
java.lang.Object value)
Sets a Bean property of the specified bean. |
protected void |
setBeanProperty(java.lang.Object target,
java.lang.String name,
java.lang.Object value,
java.lang.Class stopClass)
Sets a Bean property of the specified bean. |
static void |
setElement(java.lang.Object target,
java.lang.Object key,
java.lang.Object value,
Context context)
This method is called by the syntax "target[key] = value" |
static void |
setExitHook(Context context,
PnutsFunction func)
|
static void |
setLine(Context context,
int line)
|
protected static void |
setLine(Context context,
int beginLine,
int beginColumn)
Deprecated. |
protected static void |
setPackage(Package pkg,
Context context)
|
static java.lang.Object |
setRange(java.lang.Object target,
java.lang.Object idx1,
java.lang.Object idx2,
java.lang.Object expr,
Context context)
This method is called by the syntax "id[from..to] = sth" |
static void |
setThreadContext(Context context)
Gets the context bound to the current thread |
static java.lang.Object |
shiftArithmetic(java.lang.Object n1,
java.lang.Object n2)
>>> operation |
protected static java.lang.Object |
shiftArithmetic(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Object |
shiftLeft(java.lang.Object n1,
java.lang.Object n2)
< < operation |
protected static java.lang.Object |
shiftLeft(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Object |
shiftRight(java.lang.Object n1,
java.lang.Object n2)
>> operation |
protected static java.lang.Object |
shiftRight(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Object |
subtract(java.lang.Object n1,
java.lang.Object n2)
- operation |
protected static java.lang.Object |
subtract(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
static java.lang.Object |
subtract1(java.lang.Object n)
Subtracts 1 from a object (integer) |
protected static java.lang.Object |
subtract1(java.lang.Object n,
Context context)
|
static void |
throwException(java.lang.Object arg,
Context context)
|
static java.lang.Boolean |
toBoolean(java.lang.Object param)
Convert a given object to a boolean value |
static java.util.Enumeration |
toEnumeration(java.lang.Object target,
Context context)
|
static java.lang.Object |
transform(java.lang.Class type,
java.lang.Object obj)
|
static java.lang.Object |
transform(java.lang.Class type,
java.lang.Object obj,
Context context)
|
static java.lang.String |
unparse(SimpleNode node,
Context context)
|
static java.lang.Object |
xor(java.lang.Object n1,
java.lang.Object n2)
^ operation |
protected static java.lang.Object |
xor(java.lang.Object n1,
java.lang.Object n2,
Context context)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String INT_SYMBOL
protected static final java.lang.String SHORT_SYMBOL
protected static final java.lang.String CHAR_SYMBOL
protected static final java.lang.String BYTE_SYMBOL
protected static final java.lang.String LONG_SYMBOL
protected static final java.lang.String FLOAT_SYMBOL
protected static final java.lang.String DOUBLE_SYMBOL
protected static final java.lang.String BOOLEAN_SYMBOL
protected static final java.lang.String VOID_SYMBOL
protected static final java.lang.String CLONE
protected static final java.lang.String EXCEPTOIN_FIELD_SYMBOL
Constructor Detail |
---|
protected Runtime()
Method Detail |
---|
public java.lang.Object run(Context context)
run
in interface Executable
context
- the context in which this object is executed
public java.lang.Object execute(Context context)
context
- the context in which this object is executed
protected java.lang.Object exec(Context context)
context
- the context in which this object is executed
public static java.lang.Object callMethod(Context context, java.lang.Class c, java.lang.String name, java.lang.Object[] args, java.lang.Class[] types, java.lang.Object target)
context
- the context in which the method is calledc
- the class of methodname
- the method nameargs
- the paramterstypes
- the types of the paramterstarget
- the target object
public static java.lang.Object callConstructor(Context context, java.lang.Class c, java.lang.Object[] args, java.lang.Class[] types)
context
- the context in which the constructor is calledc
- the class of methodargs
- the paramterstypes
- the types of the formal arguments
protected java.lang.Object _callMethod(Context context, java.lang.Class c, java.lang.String name, java.lang.Object[] args, java.lang.Class[] types, java.lang.Object target)
context
- the contextc
- the class of methodname
- the method nameargs
- the paramterstypes
- the types of the formal argumentstarget
- the target object
protected static java.lang.reflect.Method findCallableMethod(java.lang.Class clazz, java.lang.String name, java.lang.Class[] args)
protected java.lang.Object _callConstructor(Context context, java.lang.Class c, java.lang.Object[] args, java.lang.Class[] types)
context
- the context in which the constructor is calledc
- the class of methodargs
- the paramterstypes
- the types of the formal arguments
public static void putStaticField(Context context, java.lang.Class clazz, java.lang.String name, java.lang.Object expr)
context
- the context in which the field is accessedclazz
- the class in which the static field is definedname
- the name of the static fieldexpr
- the value to be assignedpublic static java.lang.Object getStaticField(Context context, java.lang.Class clazz, java.lang.String name)
context
- the context in which the field is accessedclazz
- the class in which the static field is definedname
- the name of the static field
public static void putField(Context context, java.lang.Object target, java.lang.String name, java.lang.Object expr)
context
- the context in which the field is accessedtarget
- the target object of the fieldname
- the name of the fieldexpr
- the value to be assignedpublic static java.lang.Object getField(Context context, java.lang.Object target, java.lang.String name)
context
- the context in which the field is accessedtarget
- the target object of the fieldname
- the name of the field
public static java.lang.Class getBottomType(java.lang.Class clazz)
clazz
- An array type to be examined
public static java.lang.Class arrayType(java.lang.Class c, int dim)
c
- the component typedim
- the number of dimensionsprotected static int arraydim(java.lang.Object o)
public static java.lang.Object transform(java.lang.Class type, java.lang.Object obj)
public static java.lang.Object transform(java.lang.Class type, java.lang.Object obj, Context context)
protected static int matchType(java.lang.Class type, java.lang.Object obj)
protected static java.lang.reflect.Method[] getMethods(Context context, java.lang.Class cls)
protected static java.lang.reflect.Constructor[] getConstructors(Context context, java.lang.Class cls)
public static java.lang.Object[] parseInt(java.lang.String str) throws ParseException
ParseException
public static java.lang.Object[] parseFloat(java.lang.String str)
public static java.lang.String parseString(java.lang.String str) throws ParseException
ParseException
public static java.lang.Character parseChar(java.lang.String str) throws ParseException
ParseException
public static java.lang.Object quantity(java.lang.Number number, java.lang.String numberString, java.lang.String unit, Context context)
number
- a number objectnumberString
- a symbol of the number literalunit
- a unit symbolcontext
- a context in which the quantity is createdpublic static java.lang.Object primitive(Context context, java.lang.Class primitiveType, java.lang.Object param, boolean flag)
context
- the contextprimitiveType
- a primitive typeparam
- the parameterflag
- string <->number conversionpublic static java.lang.Boolean toBoolean(java.lang.Object param)
public static java.lang.Object cast(Context context, java.lang.Class type, java.lang.Object object, boolean flag)
context
- the contexttype
- the typeflag
- object_array <->primitive_array conversionpublic static final boolean isArray(java.lang.Object obj)
obj
- the object to be checked
public static final int getArrayLength(java.lang.Object array)
array
- the array
public static java.lang.Object getRange(java.lang.Object target, java.lang.Object idx1, java.lang.Object idx2, Context context)
public static java.lang.Object setRange(java.lang.Object target, java.lang.Object idx1, java.lang.Object idx2, java.lang.Object expr, Context context)
public static java.lang.String replaceChar(java.lang.String str, java.lang.Number n, java.lang.Object expr)
protected static void checkException(Context context, java.lang.Throwable throwable)
protected static void checkException(Context context, java.lang.Throwable throwable, Runtime.TypeMap tmap)
context
- the Context in which the exception is checkedthrowable
- the exceptiontmap
- the exception handler tableprotected static void catchException(java.lang.Class type, PnutsFunction func, Context context)
type
- the exception type of which an exception handler is registeredfunc
- the function to be registered as an exception handlercontext
- the context in which the exception handler is registeredpublic static void throwException(java.lang.Object arg, Context context)
public static void setExitHook(Context context, PnutsFunction func)
public static java.lang.Object getElement(java.lang.Object target, java.lang.Object key, Context context)
public static java.lang.Object getElementAt(java.lang.Object target, int idx, Context context)
public static void setElement(java.lang.Object target, java.lang.Object key, java.lang.Object value, Context context)
public static java.util.Enumeration toEnumeration(java.lang.Object target, Context context)
protected static final java.lang.Object callFunction(Context context, PnutsFunction func, java.lang.Object[] args)
context
- the context in which the function is calledfunc
- the function to be calledargs
- the argumentspublic static final java.lang.Object call(Context context, java.lang.Object target, java.lang.Object[] args, java.lang.Class[] casts)
public static final java.lang.Object call(Context context, java.lang.Object target, java.lang.Object[] args, java.lang.Class[] casts, int line, int column)
protected static java.lang.Object newInstance(Context context, java.lang.Class c, java.lang.Object[] args, java.lang.Class[] casts)
protected static java.lang.Object makeArray(java.lang.Object[] parameters, Context context)
protected static java.util.Map createMap(int size, Context context)
protected static java.util.List createList(Context context)
protected static void jump(java.lang.Object v)
protected static void escape(java.lang.Object v)
protected static void setLine(Context context, int beginLine, int beginColumn)
public static void setLine(Context context, int line)
protected static int getBeginLine(Context context)
protected static int getBeginColumn(Context context)
protected static int getEndLine(Context context)
protected static Function getFunction(PnutsFunction pf, int nargs)
protected static java.util.Enumeration getFunctions(PnutsFunction pf)
protected static Runtime getRuntime(Context context)
protected static java.lang.Object getScriptSource(Context context)
protected static Function getFunction(Context context)
protected static void setPackage(Package pkg, Context context)
public static java.lang.String format(java.lang.Object object, int maxArrayLength)
object
- the target object.maxArrayLength
- When the target object is an array and maxArrayLength is
greater than zero, only the first maxArrayLength elements are
printed and the rest of the elements are omitted as "...".public static java.lang.String format(java.lang.Object object, int maxArrayLength, int maxFormatSize)
public static final java.lang.Object add1(java.lang.Object n)
protected static final java.lang.Object add1(java.lang.Object n, Context context)
public static final java.lang.Object subtract1(java.lang.Object n)
protected static final java.lang.Object subtract1(java.lang.Object n, Context context)
public static final java.lang.Object negate(java.lang.Object n)
protected static final java.lang.Object negate(java.lang.Object n, Context context)
public static final java.lang.Object not(java.lang.Object n)
protected static final java.lang.Object not(java.lang.Object n, Context context)
public static final java.lang.Object add(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object add(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object subtract(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object subtract(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object multiply(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object multiply(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object divide(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object divide(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object mod(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object mod(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object shiftLeft(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object shiftLeft(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object shiftRight(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object shiftRight(java.lang.Object n1, java.lang.Object n2, Context context)
public static java.lang.Object shiftArithmetic(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object shiftArithmetic(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object or(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object or(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object and(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object and(java.lang.Object n1, java.lang.Object n2, Context context)
public static final java.lang.Object xor(java.lang.Object n1, java.lang.Object n2)
protected static final java.lang.Object xor(java.lang.Object n1, java.lang.Object n2, Context context)
public static final boolean lt(java.lang.Object n1, java.lang.Object n2)
protected static final boolean lt(java.lang.Object n1, java.lang.Object n2, Context context)
public static final boolean gt(java.lang.Object n1, java.lang.Object n2)
protected static final boolean gt(java.lang.Object n1, java.lang.Object n2, Context context)
public static final boolean ge(java.lang.Object n1, java.lang.Object n2)
protected static final boolean ge(java.lang.Object n1, java.lang.Object n2, Context context)
public static final boolean le(java.lang.Object n1, java.lang.Object n2)
protected static final boolean le(java.lang.Object n1, java.lang.Object n2, Context context)
public static final boolean eq(java.lang.Object n1, java.lang.Object n2)
protected static final boolean eq(java.lang.Object n1, java.lang.Object n2, Context context)
public static final boolean ne(java.lang.Object n1, java.lang.Object n2)
protected static final boolean ne(java.lang.Object n1, java.lang.Object n2, Context context)
public static final int compareTo(java.lang.Object n1, java.lang.Object n2)
protected static final int compareTo(java.lang.Object n1, java.lang.Object n2, Context context)
public static int compareObjects(java.lang.Object e1, java.lang.Object e2)
public static java.net.URL getScriptURL(java.lang.String name, Context context)
public static Executable getCompiledScript(java.lang.String name, Context context)
name
- the script namecontext
- the context in which the class is loaded.
public static java.net.URL fileToURL(java.io.File file) throws java.io.IOException
file
- the File object
java.io.IOException
public static java.io.Reader getScriptReader(java.io.InputStream in, Context context)
in
- the input streamcontext
- the executing context
public static void printError(java.lang.Throwable t, Context context)
protected static java.lang.String getMessage(java.lang.String bundleName, java.lang.String key, java.lang.Object[] a)
public static java.lang.String getProperty(java.lang.String key)
public static void setBeanProperty(Context context, java.lang.Object target, java.lang.String name, java.lang.Object value)
context
- the contexttarget
- the target beanname
- the Bean property namevalue
- the value of the Bean propertypublic static java.lang.Object getBeanProperty(Context context, java.lang.Object target, java.lang.String name)
context
- the contexttarget
- the target beanname
- the Bean property namepublic java.lang.Object getBeanProperty(java.lang.Object target, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
target
- the target beanname
- the Bean property name
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
protected java.lang.Object getBeanProperty(java.lang.Object target, java.lang.String name, java.lang.Class stopClass) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
target
- the target beanname
- the Bean property namestopClass
- the Introspector's "stopClass"
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
protected static java.lang.reflect.Field getField(java.lang.Class cls, java.lang.String name)
public void setBeanProperty(java.lang.Object target, java.lang.String name, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
target
- the target beanname
- the Bean property namevalue
- the new property value
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
protected void setBeanProperty(java.lang.Object target, java.lang.String name, java.lang.Object value, java.lang.Class stopClass) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
target
- the target beanname
- the Bean property namevalue
- the new property valuestopClass
- the Introspector's "stopClass"
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public java.lang.Class getBeanPropertyType(java.lang.Class cls, java.lang.String name)
cls
- the class of the beanname
- the property name of the bean property
public static boolean isGenerator(SimpleNode node)
public static java.lang.Object applyGenerator(Generator g, PnutsFunction closure, Context context)
public static void addImport(Context context, java.lang.String name)
public static void addStaticMembers(Context context, java.lang.String name, boolean wildcard)
protected static PnutsFunction defineUnboundFunction(Function f, java.lang.String symbol, Package pkg)
protected static PnutsFunction defineTopLevelFunction(Function f, java.lang.String symbol, Package pkg, Context context)
public static java.lang.String unparse(SimpleNode node, Context context)
public static void setThreadContext(Context context)
context
- the contextpublic static Context getThreadContext()
public static java.lang.String saveNode(SimpleNode node)
public static SimpleNode loadNode(java.lang.String str)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |