KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > classfile > CPEntry


1 /*
2  * CPEntry.java
3  *
4  * The contents of this file are subject to the terms of the Common Development
5  * and Distribution License (the License). You may not use this file except in
6  * compliance with the License.
7  *
8  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
9  * or http://www.netbeans.org/cddl.txt.
10  *
11  * When distributing Covered Code, include this CDDL Header Notice in each file
12  * and include the License file at http://www.netbeans.org/cddl.txt.
13  * If applicable, add the following below the CDDL Header, with the fields
14  * enclosed by brackets [] replaced by your own identifying information:
15  * "Portions Copyrighted [year] [name of copyright owner]"
16  *
17  * The Original Software is NetBeans. The Initial Developer of the Original
18  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
19  * Microsystems, Inc. All Rights Reserved.
20  *
21  * Contributor(s): Thomas Ball
22  *
23  * Version: $Revision: 1.5 $
24  */

25
26 package org.netbeans.modules.classfile;
27
28
29 /**
30  * A class representing an entry in a ConstantPool.
31  *
32  * @author Thomas Ball
33  */

34 public abstract class CPEntry {
35
36     ConstantPool pool;
37     Object JavaDoc value;
38
39     CPEntry(ConstantPool pool) {
40     this.pool = pool;
41     }
42
43     void resolve(CPEntry[] pool) {
44         // already resolved by default
45
}
46
47     /* The VM doesn't allow the next constant pool slot to be used
48      * for longs and doubles.
49      */

50     boolean usesTwoSlots() {
51     return false;
52     }
53     
54     public Object JavaDoc getValue() {
55         return value;
56     }
57
58     /**
59      * Returns the constant type value, or tag, as defined by
60      * table 4.3 of the Java Virtual Machine specification.
61      */

62     public abstract int getTag();
63 }
64
65
Popular Tags