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 / RemoteField.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  3.0 KB  |  125 lines

  1. package sun.tools.debug;
  2.  
  3. import sun.tools.java.Type;
  4.  
  5. public class RemoteField extends Field implements AgentConstants {
  6.    RemoteAgent agent;
  7.  
  8.    RemoteField(RemoteAgent var1, int var2, String var3, String var4, short var5, RemoteClass var6) {
  9.       this.agent = var1;
  10.       super.slot = var2;
  11.       super.name = var3;
  12.       super.signature = var4;
  13.       super.access = var5;
  14.       super.clazz = var6;
  15.    }
  16.  
  17.    public String getName() {
  18.       return super.name;
  19.    }
  20.  
  21.    RemoteValue getValue(int var1) throws Exception {
  22.       return this.agent.getSlotValue(var1, super.slot);
  23.    }
  24.  
  25.    void setValue(int var1, int var2) throws IllegalAccessException, Exception {
  26.       int var3 = this.getType().getTypeCode();
  27.       if (var3 == 5) {
  28.          this.setValue(var1, (long)var2);
  29.       } else if (var3 != 4 && var3 != 1 && var3 != 3) {
  30.          throw new IllegalAccessException();
  31.       } else {
  32.          this.agent.setSlotValue(var1, super.slot, var2);
  33.       }
  34.    }
  35.  
  36.    void setValue(int var1, boolean var2) throws IllegalAccessException, Exception {
  37.       if (this.getType().getTypeCode() != 0) {
  38.          throw new IllegalAccessException();
  39.       } else {
  40.          this.agent.setSlotValue(var1, super.slot, var2);
  41.       }
  42.    }
  43.  
  44.    void setValue(int var1, char var2) throws IllegalAccessException, Exception {
  45.       if (this.getType().getTypeCode() != 2) {
  46.          throw new IllegalAccessException();
  47.       } else {
  48.          this.agent.setSlotValue(var1, super.slot, var2);
  49.       }
  50.    }
  51.  
  52.    void setValue(int var1, long var2) throws IllegalAccessException, Exception {
  53.       if (this.getType().getTypeCode() != 5) {
  54.          throw new IllegalAccessException();
  55.       } else {
  56.          this.agent.setSlotValue(var1, super.slot, var2);
  57.       }
  58.    }
  59.  
  60.    void setValue(int var1, float var2) throws IllegalAccessException, Exception {
  61.       if (this.getType().getTypeCode() != 6) {
  62.          throw new IllegalAccessException();
  63.       } else {
  64.          this.agent.setSlotValue(var1, super.slot, var2);
  65.       }
  66.    }
  67.  
  68.    void setValue(int var1, double var2) throws IllegalAccessException, Exception {
  69.       if (this.getType().getTypeCode() != 7) {
  70.          throw new IllegalAccessException();
  71.       } else {
  72.          this.agent.setSlotValue(var1, super.slot, var2);
  73.       }
  74.    }
  75.  
  76.    public Type getType() {
  77.       return Type.tType(super.signature);
  78.    }
  79.  
  80.    public String getTypedName() {
  81.       return Type.tType(super.signature).typeString(super.name, true, true);
  82.    }
  83.  
  84.    public String getModifiers() {
  85.       String var1 = new String();
  86.       if ((super.access & 1) == 1) {
  87.          var1 = var1.concat("public ");
  88.       }
  89.  
  90.       if ((super.access & 2) == 2) {
  91.          var1 = var1.concat("private ");
  92.       }
  93.  
  94.       if ((super.access & 4) == 4) {
  95.          var1 = var1.concat("protected ");
  96.       }
  97.  
  98.       if ((super.access & 8) == 8) {
  99.          var1 = var1.concat("static ");
  100.       }
  101.  
  102.       if ((super.access & 128) == 128) {
  103.          var1 = var1.concat("transient ");
  104.       }
  105.  
  106.       if ((super.access & 16) == 16) {
  107.          var1 = var1.concat("final ");
  108.       }
  109.  
  110.       if ((super.access & 64) == 64) {
  111.          var1 = var1.concat("volatile ");
  112.       }
  113.  
  114.       return var1;
  115.    }
  116.  
  117.    public boolean isStatic() {
  118.       return (super.access & 8) == 8;
  119.    }
  120.  
  121.    public String toString() {
  122.       return new String(super.signature + " " + super.name);
  123.    }
  124. }
  125.