| java.lang.Object pnuts.lang.Runtime pnuts.lang.Function
Function | public class Function extends Runtime implements Serializable(Code) | | This class represents a function with a certain number of parameters. In
Pnuts, functions should be accessed through PnutsFunction. This class is used
mainly by compiler implementors. Note that there is no way to create a
Function object through public API.
|
Constructor Summary | |
protected | Function() | | Function(Function func) | protected | Function(String func, String[] locals, int nargs, SimpleNode node, Package pkg, Context context) | protected | Function(String func, String[] locals, int nargs, boolean varargs, SimpleNode node, Package pkg, Context context) |
anonymous | boolean anonymous(Code) | | |
file | protected transient Object file(Code) | | file name in which this function is defined
|
finallySet | boolean finallySet(Code) | | |
funcName | protected String funcName(Code) | | name of the function including the scope information
|
name | protected String name(Code) | | name of the function without the scope information
|
nargs | protected int nargs(Code) | | the number of arguments
|
pkgName | protected String pkgName(Code) | | the package name in which this function is defined
|
serialVersionUID | final static long serialVersionUID(Code) | | |
varargs | protected boolean varargs(Code) | | variable length arugments
|
Function | protected Function()(Code) | | |
getName | public synchronized String getName()(Code) | | Returns the name of the function
|
getNumberOfParameter | public int getNumberOfParameter()(Code) | | Returns the number of parameters
|
Methods inherited from pnuts.lang.Runtime | protected Object _callConstructor(Context context, Class c, Object args, Class types)(Code)(Java Doc) protected Object _callMethod(Context context, Class c, String name, Object args, Class types, Object target)(Code)(Java Doc) protected Object _getField(Context context, Class c, String name, Object target)(Code)(Java Doc) protected void _putField(Context context, Class cls, String name, Object target, Object value)(Code)(Java Doc) final public static Object add(Object n1, Object n2)(Code)(Java Doc) final protected static Object add(Object n1, Object n2, Context context)(Code)(Java Doc) final public static Object add1(Object n)(Code)(Java Doc) final protected static Object add1(Object n, Context context)(Code)(Java Doc) public static void addImport(Context context, String name)(Code)(Java Doc) public static void addStaticMembers(Context context, String name, boolean wildcard)(Code)(Java Doc) final public static Object and(Object n1, Object n2)(Code)(Java Doc) final protected static Object and(Object n1, Object n2, Context context)(Code)(Java Doc) public static Object applyGenerator(Generator g, PnutsFunction closure, Context context)(Code)(Java Doc) public static Class arrayType(Class c, int dim)(Code)(Java Doc) protected static int arraydim(Object o)(Code)(Java Doc) final public static Object call(Context context, Object target, Object[] args, Class[] casts)(Code)(Java Doc) final public static Object call(Context context, Object target, Object[] args, Class[] casts, int line, int column)(Code)(Java Doc) public static Object callConstructor(Context context, Class c, Object args, Class types)(Code)(Java Doc) final protected static Object callFunction(Context context, PnutsFunction func, Object[] args)(Code)(Java Doc) public static Object callMethod(Context context, Class c, String name, Object args, Class types, Object target)(Code)(Java Doc) public static Object cast(Context context, Class type, Object object, boolean flag)(Code)(Java Doc) protected static void catchException(Class type, PnutsFunction func, Context context)(Code)(Java Doc) protected static void checkException(Context context, Throwable throwable)(Code)(Java Doc) protected static void checkException(Context context, Throwable throwable, TypeMap tmap)(Code)(Java Doc) static int compareArrays(Object a1, Object a2)(Code)(Java Doc) static int compareListToArray(List ol, Object array)(Code)(Java Doc) static int compareLists(List ol1, List ol2)(Code)(Java Doc) public static int compareObjects(Object e1, Object e2)(Code)(Java Doc) final public static int compareTo(Object n1, Object n2)(Code)(Java Doc) final protected static int compareTo(Object n1, Object n2, Context context)(Code)(Java Doc) static Number compress(Number n)(Code)(Java Doc) public static Cache createCache()(Code)(Java Doc) protected static List createList(Context context)(Code)(Java Doc) protected static Map createMap(int size, Context context)(Code)(Java Doc) public static Map createWeakMap()(Code)(Java Doc) static Number decimalNumber(String s, int radix)(Code)(Java Doc) protected static PnutsFunction defineTopLevelFunction(Function f, String symbol, Package pkg, Context context)(Code)(Java Doc) protected static PnutsFunction defineUnboundFunction(Function f, String symbol, Package pkg)(Code)(Java Doc) static void deserializePnutsFunction(PnutsFunction pnutsFunction, ObjectInputStream s) throws IOException, ClassNotFoundException(Code)(Java Doc) final public static Object divide(Object n1, Object n2)(Code)(Java Doc) final protected static Object divide(Object n1, Object n2, Context context)(Code)(Java Doc) final public static boolean eq(Object n1, Object n2)(Code)(Java Doc) final protected static boolean eq(Object n1, Object n2, Context context)(Code)(Java Doc) protected static void escape(Object v)(Code)(Java Doc) protected Object exec(Context context)(Code)(Java Doc) public Object execute(Context context)(Code)(Java Doc) public static URL fileToURL(File file) throws IOException(Code)(Java Doc) protected static Method findCallableMethod(Class clazz, String name, Class args)(Code)(Java Doc) public static String format(Object object, int maxArrayLength)(Code)(Java Doc) public static String format(Object object, int maxArrayLength, int maxFormatSize)(Code)(Java Doc) public static String format(Object object, int maxArrayLength, int maxFormatSize, char[] paren)(Code)(Java Doc) static void format(Object object, int maxArrayLength, int maxFormatSize, char[] paren, Set formattedObjects, StringBuffer sb)(Code)(Java Doc) static void formatElement(Object obj, int maxArrayLength, int maxFormatSize, char[] paren, Set formattedObjects, StringBuffer sb)(Code)(Java Doc) final public static boolean ge(Object n1, Object n2)(Code)(Java Doc) final protected static boolean ge(Object n1, Object n2, Context context)(Code)(Java Doc) final public static int getArrayLength(Object array)(Code)(Java Doc) public static Object getBeanProperty(Context context, Object target, String name)(Code)(Java Doc) public Object getBeanProperty(Object target, String name) throws IllegalAccessException, InvocationTargetException(Code)(Java Doc) protected Object getBeanProperty(Object target, String name, Class stopClass) throws IllegalAccessException, InvocationTargetException(Code)(Java Doc) public Class getBeanPropertyType(Class cls, String name)(Code)(Java Doc) protected static int getBeginColumn(Context context)(Code)(Java Doc) protected static int getBeginLine(Context context)(Code)(Java Doc) public static boolean getBoolean(String key)(Code)(Java Doc) public static Class getBottomType(Class clazz)(Code)(Java Doc) static String getClassName(Class cls)(Code)(Java Doc) public static Executable getCompiledScript(String name, Context context)(Code)(Java Doc) protected static Constructor[] getConstructors(Context context, Class cls)(Code)(Java Doc) static ImportEnv getDefaultImports(Context context)(Code)(Java Doc) public static Runtime getDefaultRuntime()(Code)(Java Doc) public static Object getElement(Object target, Object key, Context context)(Code)(Java Doc) public static Object getElementAt(Object target, int idx, Context context)(Code)(Java Doc) protected static int getEndLine(Context context)(Code)(Java Doc) public static Object getField(Context context, Object target, String name)(Code)(Java Doc) protected Field getField(Class cls, String name)(Code)(Java Doc) protected static Function getFunction(PnutsFunction pf, int nargs)(Code)(Java Doc) protected static Function getFunction(Context context)(Code)(Java Doc) protected static Enumeration getFunctions(PnutsFunction pf)(Code)(Java Doc) protected static String getMessage(String bundleName, String key, Object a)(Code)(Java Doc) protected static Method[] getMethods(Context context, Class cls)(Code)(Java Doc) public static String getProperty(String key)(Code)(Java Doc) public static Object getRange(Object target, Object idx1, Object idx2, Context context)(Code)(Java Doc) protected static Runtime getRuntime(Context context)(Code)(Java Doc) public static Reader getScriptReader(InputStream in, Context context)(Code)(Java Doc) protected static Object getScriptSource(Context context)(Code)(Java Doc) public static URL getScriptURL(String name, Context context)(Code)(Java Doc) public static Object getStaticField(Context context, Class clazz, String name)(Code)(Java Doc) public static Context getThreadContext()(Code)(Java Doc) final public static boolean gt(Object n1, Object n2)(Code)(Java Doc) final protected static boolean gt(Object n1, Object n2, Context context)(Code)(Java Doc) final public static boolean isArray(Object obj)(Code)(Java Doc) public static boolean isGenerator(SimpleNode node)(Code)(Java Doc) protected static void jump(Object v)(Code)(Java Doc) final public static boolean le(Object n1, Object n2)(Code)(Java Doc) final protected static boolean le(Object n1, Object n2, Context context)(Code)(Java Doc) public static SimpleNode loadNode(String str)(Code)(Java Doc) static Object lookupTopLevelValue(String symbol, Context context)(Code)(Java Doc) final public static boolean lt(Object n1, Object n2)(Code)(Java Doc) final protected static boolean lt(Object n1, Object n2, Context context)(Code)(Java Doc) protected static Object makeArray(Object[] parameters, Context context)(Code)(Java Doc) protected static int matchType(Class type, Object obj)(Code)(Java Doc) final public static Object mod(Object n1, Object n2)(Code)(Java Doc) final protected static Object mod(Object n1, Object n2, Context context)(Code)(Java Doc) final public static Object multiply(Object n1, Object n2)(Code)(Java Doc) final protected static Object multiply(Object n1, Object n2, Context context)(Code)(Java Doc) final public static boolean ne(Object n1, Object n2)(Code)(Java Doc) final protected static boolean ne(Object n1, Object n2, Context context)(Code)(Java Doc) final public static Object negate(Object n)(Code)(Java Doc) final protected static Object negate(Object n, Context context)(Code)(Java Doc) protected static Object newInstance(Context context, Class c, Object[] args, Class[] casts)(Code)(Java Doc) final public static Object not(Object n)(Code)(Java Doc) final protected static Object not(Object n, Context context)(Code)(Java Doc) final public static Object or(Object n1, Object n2)(Code)(Java Doc) final protected static Object or(Object n1, Object n2, Context context)(Code)(Java Doc) public static Character parseChar(String str) throws ParseException(Code)(Java Doc) public static Object[] parseFloat(String str)(Code)(Java Doc) public static Object[] parseInt(String str) throws ParseException(Code)(Java Doc) static Object[] parseInt(String str, int radix, boolean shrink) throws ParseException(Code)(Java Doc) public static String parseString(String str, int offset) throws ParseException(Code)(Java Doc) public static Object primitive(Context context, Class primitiveType, Object param, boolean flag)(Code)(Java Doc) static Object primitive(Class primitiveType, Object param, boolean flag, int radix)(Code)(Java Doc) public static void printError(Throwable t, Context context)(Code)(Java Doc) public static void putField(Context context, Object target, String name, Object expr)(Code)(Java Doc) public static void putStaticField(Context context, Class clazz, String name, Object expr)(Code)(Java Doc) public static Object quantity(Number number, String numberString, String unit, Context context)(Code)(Java Doc) static void recoverParseError(PnutsParser parser, int tokenType)(Code)(Java Doc) public static String replaceChar(String str, Number n, Object expr)(Code)(Java Doc) public Object run(Context context)(Code)(Java Doc) public static String saveNode(SimpleNode node)(Code)(Java Doc) static void serializePnutsFunction(PnutsFunction pnutsFunction, ObjectOutputStream s) throws IOException(Code)(Java Doc) public static void setBeanProperty(Context context, Object target, String name, Object value)(Code)(Java Doc) public void setBeanProperty(Object target, String name, Object value) throws IllegalAccessException, InvocationTargetException(Code)(Java Doc) protected void setBeanProperty(Object target, String name, Object value, Class stopClass) throws IllegalAccessException, InvocationTargetException(Code)(Java Doc) public static void setElement(Object target, Object key, Object value, Context context)(Code)(Java Doc) public static void setExitHook(Context context, PnutsFunction func)(Code)(Java Doc) protected static void setLine(Context context, int beginLine, int beginColumn)(Code)(Java Doc) public static void setLine(Context context, int line)(Code)(Java Doc) protected static void setPackage(Package pkg, Context context)(Code)(Java Doc) public static Object setRange(Object target, Object idx1, Object idx2, Object expr, Context context)(Code)(Java Doc) public static void setThreadContext(Context context)(Code)(Java Doc) protected static void setupPropertyChangeListeners(Map table, Context context)(Code)(Java Doc) public static Object shiftArithmetic(Object n1, Object n2)(Code)(Java Doc) final protected static Object shiftArithmetic(Object n1, Object n2, Context context)(Code)(Java Doc) final public static Object shiftLeft(Object n1, Object n2)(Code)(Java Doc) final protected static Object shiftLeft(Object n1, Object n2, Context context)(Code)(Java Doc) final public static Object shiftRight(Object n1, Object n2)(Code)(Java Doc) final protected static Object shiftRight(Object n1, Object n2, Context context)(Code)(Java Doc) final public static Object subtract(Object n1, Object n2)(Code)(Java Doc) final protected static Object subtract(Object n1, Object n2, Context context)(Code)(Java Doc) final public static Object subtract1(Object n)(Code)(Java Doc) final protected static Object subtract1(Object n, Context context)(Code)(Java Doc) public static void throwException(Object arg, Context context)(Code)(Java Doc) public static Boolean toBoolean(Object param)(Code)(Java Doc) public static Enumeration toEnumeration(Object target, Context context)(Code)(Java Doc) protected static SimpleNode toFunctionNode(SimpleNode body)(Code)(Java Doc) public static Object transform(Class type, Object obj)(Code)(Java Doc) public static Object transform(Class type, Object obj, Context context)(Code)(Java Doc) public static String unparse(SimpleNode node, Context context)(Code)(Java Doc) protected static void watchProperty(Map table, Object obj, String property, Object memberTarget, String memberName, Callable rhs)(Code)(Java Doc) final public static Object xor(Object n1, Object n2)(Code)(Java Doc) final protected static Object xor(Object n1, Object n2, Context context)(Code)(Java Doc)
|
|
|