All Packages Class Hierarchy This Package Previous Next Index
Class pnuts.ext.DynamicClass
pnuts.lang.PnutsFunction
|
+----pnuts.ext.DynamicClass
- public class DynamicClass
- extends PnutsFunction
An implementation of class-based inheritance.
See Pnuts User's Guide for details.
- See Also:
- AbstractData
-
DynamicClass(String)
-
-
add(String)
- declare an attribute of the Object class
-
add(String, Class)
- declare an attribute of the specified class
-
add(String, DynamicClass)
- declare an attribute of the specified type
-
attributeType(String)
-
-
call(Object[], Context)
- call a function in "context" with arguments "args"
-
declare(String, DynamicClass)
- Declare a type which behaves as a "class".
-
getAttributes()
-
-
getMethods()
-
-
getName()
- get the name of type
-
getSuperType()
- get the supertype
-
isSubTypeOf(DynamicClass)
- check if the type is subtype of the specified type
-
method(String, PnutsFunction)
- func should be a one parameter function returns another function
like: function name (x){ function (y, z) y + z }
-
remove(String)
- remove an attribute
-
toString()
-
DynamicClass
protected DynamicClass(String name)
declare
public static DynamicClass declare(String name,
DynamicClass superType)
- Declare a type which behaves as a "class".
It inherits attributes and methods from superType
getSuperType
public DynamicClass getSuperType()
- get the supertype
getName
public String getName()
- get the name of type
- Overrides:
- getName in class PnutsFunction
getAttributes
public Hashtable getAttributes()
getMethods
public Hashtable getMethods()
add
public void add(String name,
Class clazz)
- declare an attribute of the specified class
add
public void add(String name,
DynamicClass type)
- declare an attribute of the specified type
add
public void add(String name)
- declare an attribute of the Object class
remove
public void remove(String name)
- remove an attribute
method
public void method(String name,
PnutsFunction func)
- func should be a one parameter function returns another function
like: function name (x){ function (y, z) y + z }
attributeType
public Object attributeType(String name)
isSubTypeOf
public boolean isSubTypeOf(DynamicClass type)
- check if the type is subtype of the specified type
call
public Object call(Object args[],
Context context)
- call a function in "context" with arguments "args"
- Overrides:
- call in class PnutsFunction
toString
public String toString()
- Overrides:
- toString in class PnutsFunction
All Packages Class Hierarchy This Package Previous Next Index