class ObjectInfo
pri cl : ClassInfo;
pri fstField : ObjFieldList;
% Set and Get Methods
meth GetCl =^ (res c: ClassInfo ·
c:= cl;
)
end
meth SetCl =^ (val c: ClassInfo ·
cl:= c;
)
end
meth GetfstField =^ (res f: ObjFieldList ·
f:= fstField;
)
end
meth SetfstField =^ (val f: ObjFieldList ·
fstField := f;
)
end
meth InsertField =^ ( val cl: ClassInfo ·
Var fd : FieldList ·
Var name : String ·
cl.GetName(name);
if [] name <> "object" ®
cl.GetfstField(Fd);
self.InsertNewField (fd);
cl.GetSuper(cl);
self.InsertField(cl);
fi
end end
)
end
% Inserting a new field in the object
meth InsertNewField =^ ( val Fd: FieldList ·
Var name : String ·
Var field : FieldInfo ·
Var descriptor : String ·
Var visibility : String ·
var Item : ObjFieldInfo ·
var NewItem : ObjFieldList ·
if [] Fd <> null ®
Fd.GetField(field);
Item:= new ObjFieldInfo;
Field.GetName(name);
Item.Setname(name);
Field.GetVisibility(visibility);
Item.SetVisibility(visibility);
Field.GetDescriptor(Descriptor);
Item.BuildDataField(Descriptor);
NewItem:= new ObjFieldList;
NewItem.SetField(Item);
NewItem.SetNext(fstField);
FstField:= NewItem;
% Inserting next field
Fd.Getnext(Fd);
self.InsertNewField (fd);
Fi
end end end end end end
)
end
% Getting a data field from the object
meth GetDataFd =^ ( val N: String; res D: Object ·
FstField.GetDataFd(N, D);
)
end
% Uppdating a data field in the object
meth PutDataFd =^ ( val N: String; val D: Object ·
FstField.PutDataFd(FstField, N, D);
)
end
end