KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jas > DoubleCP


1 package jas;
2
3 import java.io.*;
4
5
6 /**
7  * Wrap an Double constant reference with this CPE.
8  *
9  * @author $Author: fqian $
10  * @version $Revision: 1.1 $
11  */

12
13 public class DoubleCP extends CP implements RuntimeConstants
14 {
15   double val;
16
17   /**
18    * @param n Value for Double constant
19    */

20   public DoubleCP(double n)
21   {
22     uniq = ("Double: @#$" + n).intern();
23     val = n;
24   }
25   void resolve(ClassEnv e) { return; }
26   void write(ClassEnv e, DataOutputStream out)
27     throws IOException
28   {
29     out.writeByte(CONSTANT_DOUBLE);
30     out.writeDouble(val);
31   }
32 }
33
Popular Tags