pnuts.ext
Class Prototype
java.lang.Object
|
+--pnuts.lang.PnutsFunction
|
+--pnuts.ext.Prototype
- public class Prototype
- extends PnutsFunction
- implements AbstractData, java.lang.Cloneable, java.io.Serializable
An implementation of prototype-based Inheritance, which is simillar to that of ECMAScript.
See Pnuts User's Guide for details.
- See Also:
AbstractData
, Serialized Form
Fields inherited from class pnuts.lang.PnutsFunction |
CATCH,
DEFINED,
EVAL,
GET_CONTEXT,
IMPORT,
LOAD,
LOAD_FILE,
PACKAGE,
primitive_names,
primitives,
QUIT,
THROW |
Method Summary |
java.lang.Object |
clone()
|
protected java.lang.Object |
exec(java.lang.Object[] args,
Context context)
Call a function in "context" with arguments "args". |
java.lang.Object |
get(java.lang.String name)
This method defines the behavior of the following expression. |
java.lang.Object |
invoke(java.lang.String name,
java.lang.Object[] args)
|
void |
set(java.lang.String name,
java.lang.Object value)
This method defines the behavior of the following expression. |
java.lang.String |
toString()
|
Methods inherited from class pnuts.lang.PnutsFunction |
accept,
autoload,
call,
call,
call,
call,
call,
defined,
get,
getId,
getImportEnv,
getName,
getPackage,
isBuiltin,
put,
unparse |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Prototype
public Prototype()
Prototype
public Prototype(java.lang.String name)
get
public java.lang.Object get(java.lang.String name)
- Description copied from interface: Property
- This method defines the behavior of the following expression.
aProperty . name
set
public void set(java.lang.String name,
java.lang.Object value)
- Description copied from interface: Property
- This method defines the behavior of the following expression.
aProperty . name = value
exec
protected java.lang.Object exec(java.lang.Object[] args,
Context context)
- Description copied from class: PnutsFunction
- Call a function in "context" with arguments "args".
Subclasses of this class should override this method.
- Overrides:
- exec in class PnutsFunction
- Tags copied from class: PnutsFunction
- Returns:
- the result of the call
invoke
public java.lang.Object invoke(java.lang.String name,
java.lang.Object[] args)
- Specified by:
- invoke in interface AbstractData
toString
public java.lang.String toString()
- Overrides:
- toString in class PnutsFunction
clone
public java.lang.Object clone()
- Overrides:
- clone in class java.lang.Object