DEADSOFTWARE

Remove batch
[gpcp-linux.git] / J2CPS / StringRef.java
1 /**********************************************************************/
2 /* String Reference class for J2CPS */
3 /* */
4 /* (c) copyright QUT */
5 /**********************************************************************/
6 package J2CPS;
8 public class StringRef {
10 ConstantPool cp; /* the constant pool containing this string ref */
11 String str; /* the string this ref refers to */
12 int strIndex; /* the CP index for this string */
14 public StringRef(ConstantPool thisCp, int strIx) {
15 this.cp = thisCp;
16 this.strIndex = strIx;
17 }
19 public String GetString() {
20 if (this.str == null) { this.str = (String) cp.Get(strIndex); }
21 return str;
22 }
24 public void Resolve() {
25 this.str = (String) this.cp.Get(strIndex);
26 }
28 @Override
29 public String toString() {
30 this.Resolve();
31 return ("<StringRef> " + this.strIndex + " " + str);
32 }
34 }