home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 1999 March / maximum-cd-1999-03.iso / Feature / Lotus / ORGANIZE / COMPNENT / LTOUIN21.ZIP / sunw / demo / classfile / UTF8Constant.class (.txt) < prev   
Encoding:
Java Class File  |  1998-03-12  |  1.2 KB  |  37 lines

  1. package sunw.demo.classfile;
  2.  
  3. import java.io.DataOutputStream;
  4. import java.io.IOException;
  5.  
  6. class UTF8Constant extends ConstantPoolEntry {
  7.    private String string;
  8.  
  9.    UTF8Constant(String var1, ClassFile var2) {
  10.       super((byte)1, var2);
  11.       this.string = var1;
  12.       ((ConstantPoolEntry)this).addToConstantPool();
  13.    }
  14.  
  15.    UTF8Constant(String var1, ClassFile var2, short var3) {
  16.       super((byte)1, var2, var3);
  17.       this.string = var1;
  18.    }
  19.  
  20.    public boolean equals(Object var1) {
  21.       return var1 instanceof UTF8Constant ? this.string.equals(((UTF8Constant)var1).getString()) : false;
  22.    }
  23.  
  24.    String getString() {
  25.       return this.string;
  26.    }
  27.  
  28.    public int hashCode() {
  29.       return this.string.hashCode();
  30.    }
  31.  
  32.    void write(DataOutputStream var1) throws IOException {
  33.       var1.writeByte(((ConstantPoolEntry)this).getTag());
  34.       var1.writeUTF(this.string);
  35.    }
  36. }
  37.