home *** CD-ROM | disk | FTP | other *** search
- package sunw.demo.classfile;
-
- import java.io.DataOutputStream;
- import java.io.IOException;
-
- class FloatConstant extends ConstantPoolEntry {
- private float floating;
-
- FloatConstant(float var1, ClassFile var2) {
- super((byte)4, var2);
- this.floating = var1;
- ((ConstantPoolEntry)this).addToConstantPool();
- }
-
- public boolean equals(Object var1) {
- if (var1 instanceof Float) {
- return this.floating == (Float)var1;
- } else if (var1 instanceof FloatConstant) {
- FloatConstant var2 = (FloatConstant)var1;
- return this.floating == var2.getValue();
- } else {
- return false;
- }
- }
-
- float getValue() {
- return this.floating;
- }
-
- public int hashCode() {
- return (int)this.floating;
- }
-
- void write(DataOutputStream var1) throws IOException {
- var1.writeByte(((ConstantPoolEntry)this).getTag());
- var1.writeFloat(this.floating);
- }
- }
-