1 24 25 package org.aspectj.compiler.base.bcg.pool; 26 27 import org.aspectj.compiler.base.bcg.*; 28 29 import java.io.*; 30 import java.util.*; 31 32 import org.aspectj.compiler.base.ast.ArrayType; 33 import org.aspectj.compiler.base.ast.NameType; 34 import org.aspectj.compiler.base.ast.RefType; 35 36 public class Utf8Constant extends Constant { 37 public String value; 38 Utf8Constant() {} 39 Utf8Constant(String value) { 40 this.value = value; 41 } 42 void writeTo(DataOutputStream stream) throws IOException { 43 stream.writeByte(UTF_TAG); 44 stream.writeUTF(value); 45 } 46 public String toString() { 47 return rep(getIndex(), 48 "\"" + value + "\""); 49 } 50 public boolean equals(Object other) { 51 if (! (other instanceof Utf8Constant)) return false; 52 Utf8Constant o = (Utf8Constant) other; 53 return value.equals(o.value); 54 } 55 public int hashCode() { 56 return value.hashCode() + UTF_TAG; 57 } 58 59 void readFrom(DataInputStream stream, ConstantPool pool) throws IOException { 60 value = stream.readUTF(); 61 } 62 } 63 | Popular Tags |