📄 constantpool.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Sat Dec 15 07:40:13 EST 2001 --><TITLE>bcel API: Class ConstantPool</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ConstantPool.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/apache/bcel/classfile/ConstantNameAndType.html"><B>PREV CLASS</B></A> <A HREF="../../../../org/apache/bcel/classfile/ConstantString.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ConstantPool.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.apache.bcel.classfile</FONT><BR>Class ConstantPool</H2><PRE>java.lang.Object | +--<B>org.apache.bcel.classfile.ConstantPool</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.lang.Cloneable, <A HREF="../../../../org/apache/bcel/classfile/Node.html">Node</A></DD></DL><HR><DL><DT>public class <B>ConstantPool</B><DT>extends java.lang.Object<DT>implements java.lang.Cloneable, <A HREF="../../../../org/apache/bcel/classfile/Node.html">Node</A></DL><P>This class represents the constant pool, i.e., a table of constants. It may contain null references, due to the JVM specification that skips an entry after an 8-byte constant (double, long) entry.<P><DL><DT><B>Version: </B><DD>$Id: ConstantPool.java,v 1.1.1.1 2001/10/29 19:59:59 jvanzyl Exp $</DD><DT><B>Author: </B><DD><A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A></DD><DT><B>See Also: </B><DD><A HREF="../../../../org/apache/bcel/classfile/Constant.html"><CODE>Constant</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#ConstantPool(org.apache.bcel.classfile.Constant[])">ConstantPool</A></B>(<A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A>[] constant_pool)</CODE><BR> </TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#accept(org.apache.bcel.classfile.Visitor)">accept</A></B>(<A HREF="../../../../org/apache/bcel/classfile/Visitor.html">Visitor</A> v)</CODE><BR> Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#constantToString(org.apache.bcel.classfile.Constant)">constantToString</A></B>(<A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A> c)</CODE><BR> Resolve constant to a string representation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#constantToString(int, byte)">constantToString</A></B>(int index, byte tag)</CODE><BR> Retrieve constant at `index' from constant pool and resolve it to a string representation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html">ConstantPool</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#copy()">copy</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#dump(java.io.DataOutputStream)">dump</A></B>(java.io.DataOutputStream file)</CODE><BR> Dump constant pool to file stream in binary format.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#getConstant(int)">getConstant</A></B>(int index)</CODE><BR> Get constant from constant pool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#getConstant(int, byte)">getConstant</A></B>(int index, byte tag)</CODE><BR> Get constant from constant pool and check whether it has the expected type.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#getConstantPool()">getConstantPool</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#getConstantString(int, byte)">getConstantString</A></B>(int index, byte tag)</CODE><BR> Get string from constant pool and bypass the indirection of `ConstantClass' and `ConstantString' objects.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#getLength()">getLength</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#setConstant(int, org.apache.bcel.classfile.Constant)">setConstant</A></B>(int index, <A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A> constant)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#setConstantPool(org.apache.bcel.classfile.Constant[])">setConstantPool</A></B>(<A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A>[] constant_pool)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html#toString()">toString</A></B>()</CODE><BR> </TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="ConstantPool(org.apache.bcel.classfile.Constant[])"><!-- --></A><H3>ConstantPool</H3><PRE>public <B>ConstantPool</B>(<A HREF="../../../../org/apache/bcel/classfile/Constant.html">Constant</A>[] constant_pool)</PRE><DL><DD><DL><DT><B>Parameters:</B><DD><CODE>constant_pool</CODE> - Array of constants</DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -