home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / sun / tools / debug / RemoteObject.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  4.2 KB  |  171 lines

  1. package sun.tools.debug;
  2.  
  3. public class RemoteObject extends RemoteValue {
  4.    RemoteAgent agent;
  5.    RemoteClass clazz;
  6.    // $FF: renamed from: id int
  7.    int field_0;
  8.  
  9.    RemoteObject(RemoteAgent var1, int var2, RemoteClass var3) {
  10.       this(var1, 17, var2, var3);
  11.    }
  12.  
  13.    RemoteObject(RemoteAgent var1, int var2, int var3, RemoteClass var4) {
  14.       super(var2);
  15.       this.agent = var1;
  16.       this.field_0 = var3;
  17.       this.clazz = var4;
  18.    }
  19.  
  20.    public String typeName() throws Exception {
  21.       return "Object";
  22.    }
  23.  
  24.    public final int getId() {
  25.       return this.field_0;
  26.    }
  27.  
  28.    public final RemoteClass getClazz() {
  29.       return this.clazz;
  30.    }
  31.  
  32.    public RemoteValue getFieldValue(int var1) throws Exception {
  33.       return this.clazz.getInstanceField(var1).getValue(this.field_0);
  34.    }
  35.  
  36.    public RemoteValue getFieldValue(String var1) throws Exception {
  37.       RemoteField[] var2 = this.clazz.getInstanceFields();
  38.  
  39.       for(int var3 = 0; var3 < var2.length; ++var3) {
  40.          if (var1.equals(var2[var3].getName())) {
  41.             return var2[var3].getValue(this.field_0);
  42.          }
  43.       }
  44.  
  45.       return null;
  46.    }
  47.  
  48.    public RemoteField[] getFields() throws Exception {
  49.       return this.clazz.getInstanceFields();
  50.    }
  51.  
  52.    public RemoteField getField(int var1) throws Exception {
  53.       return this.clazz.getInstanceField(var1);
  54.    }
  55.  
  56.    public RemoteField getField(String var1) throws Exception {
  57.       RemoteField[] var2 = this.clazz.getInstanceFields();
  58.  
  59.       for(int var3 = 0; var3 < var2.length; ++var3) {
  60.          if (var1.equals(var2[var3].getName())) {
  61.             return var2[var3];
  62.          }
  63.       }
  64.  
  65.       return null;
  66.    }
  67.  
  68.    public void setField(String var1, boolean var2) throws Exception {
  69.       RemoteField var3 = this.getField(var1);
  70.       if (var3 == null) {
  71.          throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
  72.       } else {
  73.          var3.setValue(this.field_0, var2);
  74.       }
  75.    }
  76.  
  77.    public void setField(String var1, int var2) throws Exception {
  78.       RemoteField var3 = this.getField(var1);
  79.       if (var3 == null) {
  80.          throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
  81.       } else {
  82.          var3.setValue(this.field_0, var2);
  83.       }
  84.    }
  85.  
  86.    public void setField(String var1, char var2) throws Exception {
  87.       RemoteField var3 = this.getField(var1);
  88.       if (var3 == null) {
  89.          throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
  90.       } else {
  91.          var3.setValue(this.field_0, var2);
  92.       }
  93.    }
  94.  
  95.    public void setField(String var1, long var2) throws Exception {
  96.       RemoteField var4 = this.getField(var1);
  97.       if (var4 == null) {
  98.          throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
  99.       } else {
  100.          var4.setValue(this.field_0, var2);
  101.       }
  102.    }
  103.  
  104.    public void setField(String var1, float var2) throws Exception {
  105.       RemoteField var3 = this.getField(var1);
  106.       if (var3 == null) {
  107.          throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
  108.       } else {
  109.          var3.setValue(this.field_0, var2);
  110.       }
  111.    }
  112.  
  113.    public void setField(String var1, double var2) throws Exception {
  114.       RemoteField var4 = this.getField(var1);
  115.       if (var4 == null) {
  116.          throw new IllegalAccessException(var1 + " is not an instance variable of " + this);
  117.       } else {
  118.          var4.setValue(this.field_0, var2);
  119.       }
  120.    }
  121.  
  122.    public void setField(String var1, RemoteObject var2) throws Exception {
  123.       throw new IllegalAccessException();
  124.    }
  125.  
  126.    public void setField(int var1, boolean var2) throws Exception {
  127.       this.getField(var1).setValue(this.field_0, var2);
  128.    }
  129.  
  130.    public void setField(int var1, int var2) throws Exception {
  131.       this.getField(var1).setValue(this.field_0, var2);
  132.    }
  133.  
  134.    public void setField(int var1, char var2) throws Exception {
  135.       this.getField(var1).setValue(this.field_0, var2);
  136.    }
  137.  
  138.    public void setField(int var1, long var2) throws Exception {
  139.       this.getField(var1).setValue(this.field_0, var2);
  140.    }
  141.  
  142.    public void setField(int var1, float var2) throws Exception {
  143.       this.getField(var1).setValue(this.field_0, var2);
  144.    }
  145.  
  146.    public void setField(int var1, double var2) throws Exception {
  147.       this.getField(var1).setValue(this.field_0, var2);
  148.    }
  149.  
  150.    public void setField(int var1, RemoteObject var2) throws Exception {
  151.       throw new IllegalAccessException();
  152.    }
  153.  
  154.    public String description() {
  155.       try {
  156.          return this.clazz == null ? RemoteValue.toHex(this.field_0) : "(" + this.getClazz().getName() + ")" + RemoteValue.toHex(this.field_0);
  157.       } catch (Exception var1) {
  158.          return "<communications error>";
  159.       }
  160.    }
  161.  
  162.    public String toString() {
  163.       String var1 = this.agent.objectToString(this.field_0);
  164.       return var1.length() > 0 ? var1 : this.description();
  165.    }
  166.  
  167.    protected void finalize() throws Exception {
  168.       this.agent.objectFinalize(this.field_0);
  169.    }
  170. }
  171.