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 / DoubleConstant.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-03-12  |  1.0 KB  |  39 lines

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