1 4 package gnu.bytecode; 5 import java.io.*; 6 7 public class CpoolUtf8 extends CpoolEntry 8 { 9 String string; 10 11 CpoolUtf8 () { } 12 13 CpoolUtf8 (ConstantPool cpool, int h, String s) 14 { 15 super (cpool, h); 16 string = s; 17 } 18 19 public int hashCode () 20 { 21 if (hash == 0) 22 hash = string.hashCode(); 23 return hash; 24 } 25 26 public final void intern () { string = string.intern(); } 27 28 public int getTag() { return 1; } 30 public final String getString() 31 { 32 return string; 33 } 34 35 void write (DataOutputStream dstr) throws java.io.IOException 36 { 37 dstr.writeByte (1); dstr.writeUTF (string); 39 } 40 41 public void print (ClassTypeWriter dst, int verbosity) 42 { 43 if (verbosity > 0) 44 dst.print("Utf8: "); 45 dst.printQuotedString(string); 46 } 47 }; 48 | Popular Tags |