*/
public static void addMembers(ClassObject classObject)
{
MemberObject.addMembers(classObject);
classObject.addMethod(":initializer", 0, false, new Function()
{
public boolean invoke(int nArgCount, Machine machine)
{
machine.returnValue(((AttributeObject)machine.getArg(0, nArgCount)).getInitializerFunction(), nArgCount);
return false;
}
});
classObject.addMethod(":initializer", 1, false, new Function()
{
public boolean invoke(int nArgCount, Machine machine)
{
AttributeObject attribute = (AttributeObject)machine.getArg(0, nArgCount);
Function fun = attribute.getHolder().compile(machine.getArg(1, nArgCount),
attribute.getName(), ":initializer", machine);
attribute.setInitializerFunction(fun);
machine.returnValue(fun, nArgCount);
return false;
}
});
classObject.addMethod(":setter", 0, false, new Function()
{
public boolean invoke(int nArgCount, Machine machine)
{
machine.returnValue(((AttributeObject)machine.getArg(0, nArgCount)).getSetterFunction(), nArgCount);
return false;
}
});
classObject.addMethod(":setter", 1, false, new Function()
{
public boolean invoke(int nArgCount, Machine machine)
{
AttributeObject attribute = (AttributeObject)machine.getArg(0, nArgCount);
Function fun = attribute.getHolder().compile(machine.getArg(1, nArgCount),
attribute.getName(), ":setter", machine);
attribute.setSetterFunction(fun);
machine.returnValue(fun, nArgCount);