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

Constructor Index

 o DynamicClass(String)

Method Index

 o add(String)
declare an attribute of the Object class
 o add(String, Class)
declare an attribute of the specified class
 o add(String, DynamicClass)
declare an attribute of the specified type
 o attributeType(String)
 o call(Object[], Context)
call a function in "context" with arguments "args"
 o declare(String, DynamicClass)
Declare a type which behaves as a "class".
 o getAttributes()
 o getMethods()
 o getName()
get the name of type
 o getSuperType()
get the supertype
 o isSubTypeOf(DynamicClass)
check if the type is subtype of the specified type
 o method(String, PnutsFunction)
func should be a one parameter function returns another function like: function name (x){ function (y, z) y + z }
 o remove(String)
remove an attribute
 o toString()

Constructors

 o DynamicClass
 protected DynamicClass(String name)

Methods

 o declare
 public static DynamicClass declare(String name,
                                    DynamicClass superType)
Declare a type which behaves as a "class". It inherits attributes and methods from superType

 o getSuperType
 public DynamicClass getSuperType()
get the supertype

 o getName
 public String getName()
get the name of type

Overrides:
getName in class PnutsFunction
 o getAttributes
 public Hashtable getAttributes()
 o getMethods
 public Hashtable getMethods()
 o add
 public void add(String name,
                 Class clazz)
declare an attribute of the specified class

 o add
 public void add(String name,
                 DynamicClass type)
declare an attribute of the specified type

 o add
 public void add(String name)
declare an attribute of the Object class

 o remove
 public void remove(String name)
remove an attribute

 o 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 }

 o attributeType
 public Object attributeType(String name)
 o isSubTypeOf
 public boolean isSubTypeOf(DynamicClass type)
check if the type is subtype of the specified type

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

Overrides:
call in class PnutsFunction
 o toString
 public String toString()
Overrides:
toString in class PnutsFunction

All Packages  Class Hierarchy  This Package  Previous  Next  Index