DEADSOFTWARE

Remove batch
[gpcp-linux.git] / J2CPS / NameAndType.java
1 /**********************************************************************/
2 /* NameAndType Reference class for J2CPS */
3 /* */
4 /* (c) copyright QUT */
5 /**********************************************************************/
6 package J2CPS;
8 public class NameAndType {
10 ConstantPool cp; /* The constant pool containing this N & T */
11 int nameIndex; /* CP index for this N & T's name */
12 int typeIndex; /* CP index for this N & T'x type */
13 String name;
14 String type;
16 public NameAndType(ConstantPool thisCp, int nameIx, int typeIx) {
17 this.cp = thisCp;
18 this.nameIndex = nameIx;
19 this.typeIndex = typeIx;
20 }
22 public String GetName() {
23 if (this.name == null) { this.name = (String) this.cp.Get(nameIndex); }
24 return this.name;
25 }
27 public String GetType() {
28 if (this.type == null) { this.type = (String) this.cp.Get(typeIndex); }
29 return this.type;
30 }
32 public void Resolve() {
33 if (this.name == null) { this.name = (String) this.cp.Get(nameIndex); }
34 if (this.type == null) { this.type = (String) this.cp.Get(typeIndex); }
35 }
37 @Override
38 public String toString() {
39 this.Resolve();
40 return "<NameAndType> " + nameIndex + " " + this.name +
41 " " + typeIndex + " " + this.type;
42 }
44 }