home *** CD-ROM | disk | FTP | other *** search
- package sun.tools.debug;
-
- import sun.tools.java.Type;
-
- public class RemoteField extends Field implements AgentConstants {
- RemoteAgent agent;
-
- RemoteField(RemoteAgent var1, int var2, String var3, String var4, short var5, RemoteClass var6) {
- this.agent = var1;
- super.slot = var2;
- super.name = var3;
- super.signature = var4;
- super.access = var5;
- super.clazz = var6;
- }
-
- public String getName() {
- return super.name;
- }
-
- RemoteValue getValue(int var1) throws Exception {
- return this.agent.getSlotValue(var1, super.slot);
- }
-
- void setValue(int var1, int var2) throws IllegalAccessException, Exception {
- int var3 = this.getType().getTypeCode();
- if (var3 == 5) {
- this.setValue(var1, (long)var2);
- } else if (var3 != 4 && var3 != 1 && var3 != 3) {
- throw new IllegalAccessException();
- } else {
- this.agent.setSlotValue(var1, super.slot, var2);
- }
- }
-
- void setValue(int var1, boolean var2) throws IllegalAccessException, Exception {
- if (this.getType().getTypeCode() != 0) {
- throw new IllegalAccessException();
- } else {
- this.agent.setSlotValue(var1, super.slot, var2);
- }
- }
-
- void setValue(int var1, char var2) throws IllegalAccessException, Exception {
- if (this.getType().getTypeCode() != 2) {
- throw new IllegalAccessException();
- } else {
- this.agent.setSlotValue(var1, super.slot, var2);
- }
- }
-
- void setValue(int var1, long var2) throws IllegalAccessException, Exception {
- if (this.getType().getTypeCode() != 5) {
- throw new IllegalAccessException();
- } else {
- this.agent.setSlotValue(var1, super.slot, var2);
- }
- }
-
- void setValue(int var1, float var2) throws IllegalAccessException, Exception {
- if (this.getType().getTypeCode() != 6) {
- throw new IllegalAccessException();
- } else {
- this.agent.setSlotValue(var1, super.slot, var2);
- }
- }
-
- void setValue(int var1, double var2) throws IllegalAccessException, Exception {
- if (this.getType().getTypeCode() != 7) {
- throw new IllegalAccessException();
- } else {
- this.agent.setSlotValue(var1, super.slot, var2);
- }
- }
-
- public Type getType() {
- return Type.tType(super.signature);
- }
-
- public String getTypedName() {
- return Type.tType(super.signature).typeString(super.name, true, true);
- }
-
- public String getModifiers() {
- String var1 = new String();
- if ((super.access & 1) == 1) {
- var1 = var1.concat("public ");
- }
-
- if ((super.access & 2) == 2) {
- var1 = var1.concat("private ");
- }
-
- if ((super.access & 4) == 4) {
- var1 = var1.concat("protected ");
- }
-
- if ((super.access & 8) == 8) {
- var1 = var1.concat("static ");
- }
-
- if ((super.access & 128) == 128) {
- var1 = var1.concat("transient ");
- }
-
- if ((super.access & 16) == 16) {
- var1 = var1.concat("final ");
- }
-
- if ((super.access & 64) == 64) {
- var1 = var1.concat("volatile ");
- }
-
- return var1;
- }
-
- public boolean isStatic() {
- return (super.access & 8) == 8;
- }
-
- public String toString() {
- return new String(super.signature + " " + super.name);
- }
- }
-