KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jas > IntElemValPair


1 /**
2  * ElemValPairs are embedded into class files
3  * and used for further ???
4  * @author $Author: Jennifer Lhotak$
5  * @version $Revision: 1.1 $
6  */

7
8 package jas;
9
10 import java.io.*;
11 import java.util.*;
12
13 public class IntElemValPair extends ElemValPair {
14
15     IntegerCP val;
16
17     void resolve(ClassEnv e){
18         super.resolve(e);
19         e.addCPItem(val);
20     }
21
22     /**
23     * Note: An annotation attr is associated with a <em>class</em>,
24     * method or field so you need to create a new VisibilityAnnotationAttr for
25     */

26     public IntElemValPair(String JavaDoc name, char kind, int val) { //
27
super(name, kind);
28         this.val = new IntegerCP(val);
29     }
30
31     int size(){
32         return super.size() + 2;
33     }
34
35
36     void write(ClassEnv e, DataOutputStream out)
37         throws IOException, jasError
38         {
39         super.write(e, out);
40         out.writeShort(e.getCPIndex(val));
41     }
42 }
43
Popular Tags