All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pnuts.lang.PnutsFunction

pnuts.lang.PnutsFunction

public class PnutsFunction
A PnutsFunction represents a Pnuts function group with a same name.


Constructor Index

 o PnutsFunction()
 o PnutsFunction(String)

Method Index

 o autoload(String, String)
register "name" as an autoloaded function.
 o call(Object[])
call a function with arguments "args"
 o call(Object[], Context)
call a function in "context" with arguments "args"
 o call(String, Object[])
call a function "name" with arguments "args"
 o call(String, Object[], Context)
call a function "name" in "context" with arguments "args"
 o call(String, Object[], String)
call a function "pkg::name" with arguments "args"
 o callSafely(String, Object[])
call a function "name" with arguments "args" When "name" is not a function do nothing.
 o defined(int)
 o getId()
 o getName()
 o toString()

Constructors

 o PnutsFunction
 protected PnutsFunction()
 o PnutsFunction
 protected PnutsFunction(String name)

Methods

 o autoload
 public static void autoload(String name,
                             String file)
register "name" as an autoloaded function. Later "file" is automatically loaded if the function is not defined

 o defined
 public boolean defined(int narg)
Returns:
true if a function with narg, otherwise false
 o getId
 public String getId()
Returns:
the unique name
 o getName
 public String getName()
Returns:
the name of functions
 o call
 public Object call(Object args[],
                    Context context)
call a function in "context" with arguments "args"

Returns:
the result of the call
 o call
 public Object call(Object args[])
call a function with arguments "args"

Returns:
the result of the call
 o toString
 public String toString()
 o call
 public static Object call(String name,
                           Object args[],
                           String pkg)
call a function "pkg::name" with arguments "args"

 o call
 public static Object call(String name,
                           Object args[],
                           Context context)
call a function "name" in "context" with arguments "args"

 o call
 public static Object call(String name,
                           Object args[])
call a function "name" with arguments "args"

 o callSafely
 public static Object callSafely(String name,
                                 Object args[])
call a function "name" with arguments "args" When "name" is not a function do nothing.


All Packages  Class Hierarchy  This Package  Previous  Next  Index