1 52 53 package com.go.trove.classfile; 54 55 import java.io.*; 56 57 65 public class ConstantFloatInfo extends ConstantInfo { 66 private Float mValue; 67 68 73 static ConstantFloatInfo make(ConstantPool cp, float value) { 74 ConstantInfo ci = new ConstantFloatInfo(value); 75 return (ConstantFloatInfo)cp.addConstant(ci); 76 } 77 78 ConstantFloatInfo(float value) { 79 super(TAG_FLOAT); 80 mValue = new Float (value); 81 } 82 83 ConstantFloatInfo(Float value) { 84 super(TAG_FLOAT); 85 mValue = value; 86 } 87 88 public Float getValue() { 89 return mValue; 90 } 91 92 public int hashCode() { 93 return mValue.hashCode(); 94 } 95 96 public boolean equals(Object obj) { 97 if (obj instanceof ConstantFloatInfo) { 98 ConstantFloatInfo other = (ConstantFloatInfo)obj; 99 return mValue.equals(other.mValue); 100 } 101 102 return false; 103 } 104 105 boolean hasPriority() { 106 return true; 107 } 108 109 public void writeTo(DataOutput dout) throws IOException { 110 super.writeTo(dout); 111 dout.writeFloat(mValue.floatValue()); 112 } 113 114 public String toString() { 115 return "CONSTANT_Float_info: " + getValue(); 116 } 117 } 118 | Popular Tags |