home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / misc / ProxyGenerator$ConstantPool$ValueEntry.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.5 KB  |  38 lines

  1. package sun.misc;
  2.  
  3. import java.io.DataOutputStream;
  4. import java.io.IOException;
  5.  
  6. class ProxyGenerator$ConstantPool$ValueEntry extends ProxyGenerator.ConstantPool.Entry {
  7.    private Object value;
  8.  
  9.    public ProxyGenerator$ConstantPool$ValueEntry(Object var1) {
  10.       super((ProxyGenerator.1)null);
  11.       this.value = var1;
  12.    }
  13.  
  14.    public void write(DataOutputStream var1) throws IOException {
  15.       if (this.value instanceof String) {
  16.          var1.writeByte(1);
  17.          var1.writeUTF((String)this.value);
  18.       } else if (this.value instanceof Integer) {
  19.          var1.writeByte(3);
  20.          var1.writeInt((Integer)this.value);
  21.       } else if (this.value instanceof Float) {
  22.          var1.writeByte(4);
  23.          var1.writeFloat((Float)this.value);
  24.       } else if (this.value instanceof Long) {
  25.          var1.writeByte(5);
  26.          var1.writeLong((Long)this.value);
  27.       } else {
  28.          if (!(this.value instanceof Double)) {
  29.             throw new InternalError("bogus value entry: " + this.value);
  30.          }
  31.  
  32.          var1.writeDouble((double)6.0F);
  33.          var1.writeDouble((Double)this.value);
  34.       }
  35.  
  36.    }
  37. }
  38.