home *** CD-ROM | disk | FTP | other *** search
- package sun.tools.debug;
-
- public class RemoteObject extends RemoteValue {
- RemoteAgent agent;
- RemoteClass clazz;
- // $FF: renamed from: id int
- int field_0;
-
- RemoteObject(RemoteAgent var1, int var2, RemoteClass var3) {
- this(var1, 17, var2, var3);
- }
-
- RemoteObject(RemoteAgent var1, int var2, int var3, RemoteClass var4) {
- super(var2);
- this.agent = var1;
- this.field_0 = var3;
- this.clazz = var4;
- }
-
- public String typeName() throws Exception {
- return "Object";
- }
-
- public final int getId() {
- return this.field_0;
- }
-
- public final RemoteClass getClazz() {
- return this.clazz;
- }
-
- public RemoteValue getFieldValue(int var1) throws Exception {
- return this.clazz.getInstanceField(var1).getValue(this.field_0);
- }
-
- public RemoteValue getFieldValue(String var1) throws Exception {
- RemoteField[] var2 = this.clazz.getInstanceFields();
-
- for(int var3 = 0; var3 < var2.length; ++var3) {
- if (var1.equals(var2[var3].getName())) {
- return var2[var3].getValue(this.field_0);
- }
- }
-
- return null;
- }
-
- public RemoteField[] getFields() throws Exception {
- return this.clazz.getInstanceFields();
- }
-
- public RemoteField getField(int var1) throws Exception {
- return this.clazz.getInstanceField(var1);
- }
-
- public RemoteField getField(String var1) throws Exception {
- RemoteField[] var2 = this.clazz.getInstanceFields();
-
- for(int var3 = 0; var3 < var2.length; ++var3) {
- if (var1.equals(var2[var3].getName())) {
- return var2[var3];
- }
- }
-
- return null;
- }
-
- public void setField(String var1, boolean var2) throws Exception {
- RemoteField var3 = this.getField(var1);
- if (var3 == null) {
- throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
- } else {
- var3.setValue(this.field_0, var2);
- }
- }
-
- public void setField(String var1, int var2) throws Exception {
- RemoteField var3 = this.getField(var1);
- if (var3 == null) {
- throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
- } else {
- var3.setValue(this.field_0, var2);
- }
- }
-
- public void setField(String var1, char var2) throws Exception {
- RemoteField var3 = this.getField(var1);
- if (var3 == null) {
- throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
- } else {
- var3.setValue(this.field_0, var2);
- }
- }
-
- public void setField(String var1, long var2) throws Exception {
- RemoteField var4 = this.getField(var1);
- if (var4 == null) {
- throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
- } else {
- var4.setValue(this.field_0, var2);
- }
- }
-
- public void setField(String var1, float var2) throws Exception {
- RemoteField var3 = this.getField(var1);
- if (var3 == null) {
- throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
- } else {
- var3.setValue(this.field_0, var2);
- }
- }
-
- public void setField(String var1, double var2) throws Exception {
- RemoteField var4 = this.getField(var1);
- if (var4 == null) {
- throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
- } else {
- var4.setValue(this.field_0, var2);
- }
- }
-
- public void setField(String var1, RemoteObject var2) throws Exception {
- throw new IllegalAccessException();
- }
-
- public void setField(int var1, boolean var2) throws Exception {
- this.getField(var1).setValue(this.field_0, var2);
- }
-
- public void setField(int var1, int var2) throws Exception {
- this.getField(var1).setValue(this.field_0, var2);
- }
-
- public void setField(int var1, char var2) throws Exception {
- this.getField(var1).setValue(this.field_0, var2);
- }
-
- public void setField(int var1, long var2) throws Exception {
- this.getField(var1).setValue(this.field_0, var2);
- }
-
- public void setField(int var1, float var2) throws Exception {
- this.getField(var1).setValue(this.field_0, var2);
- }
-
- public void setField(int var1, double var2) throws Exception {
- this.getField(var1).setValue(this.field_0, var2);
- }
-
- public void setField(int var1, RemoteObject var2) throws Exception {
- throw new IllegalAccessException();
- }
-
- public String description() {
- try {
- return this.clazz == null ? RemoteValue.toHex(this.field_0) : "(" + this.getClazz().getName() + ")" + RemoteValue.toHex(this.field_0);
- } catch (Exception var1) {
- return "<communications error>";
- }
- }
-
- public String toString() {
- String var1 = this.agent.objectToString(this.field_0);
- return var1.length() > 0 ? var1 : this.description();
- }
-
- protected void finalize() throws Exception {
- this.agent.objectFinalize(this.field_0);
- }
- }
-