1 /**********************************************************************/
2 /* String Reference class for J2CPS */
4 /* (c) copyright QUT */
5 /**********************************************************************/
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
) {
16 this.strIndex
= strIx
;
19 public String
GetString() {
20 if (this.str
== null) { this.str
= (String
) cp
.Get(strIndex
); }
24 public void Resolve() {
25 this.str
= (String
) this.cp
.Get(strIndex
);
29 public String
toString() {
31 return ("<StringRef> " + this.strIndex
+ " " + str
);