KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jas > AsciiCP


1 /**
2  * This is a class to create Ascii CP entries.
3  *
4  * @author $Author: fqian $
5  * @version $Revision: 1.1 $
6  */

7
8 package jas;
9
10 import java.io.*;
11
12
13 public class AsciiCP extends CP implements RuntimeConstants
14 {
15   /**
16    * @param s Name of the ascii constant pool entry
17    */

18   public AsciiCP(String JavaDoc s)
19   { uniq = s.intern(); }
20   void resolve(ClassEnv e)
21   { return; }
22
23   public String JavaDoc toString() { return "AsciiCP: " + uniq; }
24   void write(ClassEnv e, DataOutputStream out)
25     throws IOException
26   {
27     out.writeByte(CONSTANT_UTF8);
28     out.writeUTF(uniq);
29   }
30 }
31
Popular Tags