KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > core > util > IConstantPoolEntry


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.core.util;
12
13 /**
14  * Description of a constant pool entry as described in the JVM specifications.
15  * Its contents is initialized according to its kind.
16  *
17  * This interface may be implemented by clients.
18  *
19  * @since 2.0
20  */

21 public interface IConstantPoolEntry {
22
23     /**
24      * Returns the type of this entry.
25      *
26      * @return the type of this entry
27      */

28     int getKind();
29
30     /**
31      * Returns the name index for a CONSTANT_Class type entry.
32      * The value is unspecified otherwise.
33      *
34      * @return the name index for a CONSTANT_Class type entry
35      */

36     int getClassInfoNameIndex();
37
38     /**
39      * Returns the class index for a CONSTANT_Fieldref,
40      * CONSTANT_Methodref, CONSTANT_InterfaceMethodref type entry.
41      * The value is unspecified otherwise.
42      *
43      * @return the class index for a CONSTANT_Fieldref,
44      * CONSTANT_Methodref, CONSTANT_InterfaceMethodref type entry
45      */

46     int getClassIndex();
47
48     /**
49      * Returns the nameAndType index for a CONSTANT_Fieldref,
50      * CONSTANT_Methodref, CONSTANT_InterfaceMethodref type entry.
51      * The value is unspecified otherwise.
52      *
53      * @return the nameAndType index for a CONSTANT_Fieldref,
54      * CONSTANT_Methodref, CONSTANT_InterfaceMethodref type entry
55      */

56     int getNameAndTypeIndex();
57     
58     /**
59      * Returns the string index for a CONSTANT_String type entry.
60      * The value is unspecified otherwise.
61      *
62      * @return the string index for a CONSTANT_String type entry
63      */

64     int getStringIndex();
65
66     /**
67      * Returns the string value for a CONSTANT_String type entry.
68      * Returns null otherwise.
69      *
70      * @return the string value for a CONSTANT_String type entry
71      */

72     String JavaDoc getStringValue();
73     
74     /**
75      * Returns the integer value for a CONSTANT_Integer type entry.
76      * The value is unspecified otherwise.
77      *
78      * @return the integer value for a CONSTANT_Integer type entry
79      */

80     int getIntegerValue();
81
82     /**
83      * Returns the float value for a CONSTANT_Float type entry.
84      * The value is unspecified otherwise.
85      *
86      * @return the float value for a CONSTANT_Float type entry
87      */

88     float getFloatValue();
89
90     /**
91      * Returns the double value for a CONSTANT_Double type entry.
92      * The value is unspecified otherwise.
93      *
94      * @return the double value for a CONSTANT_Double type entry
95      */

96     double getDoubleValue();
97
98     /**
99      * Returns the long value for a CONSTANT_Long type entry.
100      * The value is unspecified otherwise.
101      *
102      * @return the long value for a CONSTANT_Long type entry
103      */

104     long getLongValue();
105     
106     /**
107      * Returns the descriptor index for a CONSTANT_NameAndType type entry.
108      * The value is unspecified otherwise.
109      *
110      * @return the descriptor index for a CONSTANT_NameAndType type entry
111      */

112     int getNameAndTypeInfoDescriptorIndex();
113
114     /**
115      * Returns the name index for a CONSTANT_NameAndType type entry.
116      * The value is unspecified otherwise.
117      *
118      * @return the name index for a CONSTANT_NameAndType type entry
119      */

120     int getNameAndTypeInfoNameIndex();
121
122     /**
123      * Returns the class name for a CONSTANT_Class type entry.
124      * Returns null otherwise.
125      *
126      * @return the class name for a CONSTANT_Class type entry
127      */

128     char[] getClassInfoName();
129
130     /**
131      * Returns the class name for a CONSTANT_Fieldref,
132      * CONSTANT_Methodref, CONSTANT_InterfaceMethodref type entry.
133      * Returns null otherwise.
134      *
135      * @return the class name for a CONSTANT_Fieldref,
136      * CONSTANT_Methodref, CONSTANT_InterfaceMethodref type entry
137      */

138     char[] getClassName();
139
140     /**
141      * Returns the field name for a CONSTANT_Fieldref type entry.
142      * Returns null otherwise.
143      *
144      * @return the field name for a CONSTANT_Fieldref type entry
145      */

146     char[] getFieldName();
147     
148     /**
149      * Returns the field name for a CONSTANT_Methodref or CONSTANT_InterfaceMethodred
150      * type entry.
151      * Returns null otherwise.
152      *
153      * @return the field name for a CONSTANT_Methodref or CONSTANT_InterfaceMethodred
154      * type entry
155      */

156     char[] getMethodName();
157
158     /**
159      * Returns the field descriptor value for a CONSTANT_Fieldref type entry. This value
160      * is set only when decoding the CONSTANT_Fieldref entry.
161      * Returns null otherwise.
162      *
163      * @return the field descriptor value for a CONSTANT_Fieldref type entry. This value
164      * is set only when decoding the CONSTANT_Fieldref entry
165      */

166     char[] getFieldDescriptor();
167
168     /**
169      * Returns the method descriptor value for a CONSTANT_Methodref or
170      * CONSTANT_InterfaceMethodref type entry. This value is set only when decoding the
171      * CONSTANT_Methodref or CONSTANT_InterfaceMethodref entry.
172      * Returns null otherwise.
173      *
174      * @return the method descriptor value for a CONSTANT_Methodref or
175      * CONSTANT_InterfaceMethodref type entry. This value is set only when decoding the
176      * CONSTANT_Methodref or CONSTANT_InterfaceMethodref entry
177      */

178     char[] getMethodDescriptor();
179     
180     /**
181      * Returns the utf8 value for a CONSTANT_Utf8 type entry. This value is set only when
182      * decoding a UTF8 entry.
183      * Returns null otherwise.
184      *
185      * @return the utf8 value for a CONSTANT_Utf8 type entry. This value is set only when
186      * decoding a UTF8 entry
187      */

188     char[] getUtf8Value();
189     
190     /**
191      * Returns the utf8 length for a CONSTANT_Utf8 type entry. This value is set only when
192      * decoding a UTF8 entry.
193      * Returns null otherwise.
194      *
195      * @return the utf8 length for a CONSTANT_Utf8 type entry. This value is set only when
196      * decoding a UTF8 entry
197      */

198     int getUtf8Length();
199 }
200
Popular Tags