📄 utility.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:14 EST 2001 --><TITLE>bcel API: Class Utility</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/Utility.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/Unknown.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Utility.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 Utility</H2><PRE>java.lang.Object | +--<B>org.apache.bcel.classfile.Utility</B></PRE><HR><DL><DT>public abstract class <B>Utility</B><DT>extends java.lang.Object</DL><P>Utility functions that do not really belong to any class in particular.<P><DL><DT><B>Version: </B><DD>$Id: Utility.java,v 1.1.1.1 2001/10/29 20:00:05 jvanzyl Exp $</DD><DT><B>Author: </B><DD><A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A></DD></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/Utility.html#Utility()">Utility</A></B>()</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>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#accessToString(int)">accessToString</A></B>(int access_flags)</CODE><BR> Convert bit field of flags into string such as `static final'.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#accessToString(int, boolean)">accessToString</A></B>(int access_flags, boolean for_class)</CODE><BR> Convert bit field of flags into string such as `static final'.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#classOrInterface(int)">classOrInterface</A></B>(int access_flags)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#clearBit(int, int)">clearBit</A></B>(int flag, int i)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#codeToString(byte[], org.apache.bcel.classfile.ConstantPool, int, int)">codeToString</A></B>(byte[] code, <A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html">ConstantPool</A> constant_pool, int index, int length)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#codeToString(byte[], org.apache.bcel.classfile.ConstantPool, int, int, boolean)">codeToString</A></B>(byte[] code, <A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html">ConstantPool</A> constant_pool, int index, int length, boolean verbose)</CODE><BR> Disassemble a byte array of JVM byte codes starting from code line `index' and return the disassembled string representation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#codeToString(org.apache.bcel.util.ByteSequence, org.apache.bcel.classfile.ConstantPool)">codeToString</A></B>(<A HREF="../../../../org/apache/bcel/util/ByteSequence.html">ByteSequence</A> bytes, <A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html">ConstantPool</A> constant_pool)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#codeToString(org.apache.bcel.util.ByteSequence, org.apache.bcel.classfile.ConstantPool, boolean)">codeToString</A></B>(<A HREF="../../../../org/apache/bcel/util/ByteSequence.html">ByteSequence</A> bytes, <A HREF="../../../../org/apache/bcel/classfile/ConstantPool.html">ConstantPool</A> constant_pool, boolean verbose)</CODE><BR> Disassemble a stream of byte codes and return the string representation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#compactClassName(java.lang.String)">compactClassName</A></B>(java.lang.String str)</CODE><BR> Shorten long class names, <em>java/lang/String</em> becomes <em>String</em>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#compactClassName(java.lang.String, boolean)">compactClassName</A></B>(java.lang.String str, boolean chopit)</CODE><BR> Shorten long class names, <em>java/lang/String</em> becomes <em>java.lang.String</em>, e.g..</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#compactClassName(java.lang.String, java.lang.String, boolean)">compactClassName</A></B>(java.lang.String str, java.lang.String prefix, boolean chopit)</CODE><BR> Shorten long class name <em>str</em>, i.e., chop off the <em>prefix</em>, if the class name starts with this string and the flag <em>chopit</em> is true.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#decode(java.lang.String, boolean)">decode</A></B>(java.lang.String s, boolean uncompress)</CODE><BR> Decode a string back to a byte array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#encode(byte[], boolean)">encode</A></B>(byte[] bytes, boolean compress)</CODE><BR> Encode byte array it into Java identifier string, i.e., a string that only contains the following characters: (a, ...</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#fillup(java.lang.String, int, boolean, char)">fillup</A></B>(java.lang.String str, int length, boolean left_justify, char fill)</CODE><BR> Fillup char with up to length characters with char `fill' and justify it left or right.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#format(int, int, boolean, char)">format</A></B>(int i, int length, boolean left_justify, char fill)</CODE><BR> Return a string for an integer justified left or right and filled up with `fill' characters if necessary.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/bcel/classfile/Utility.html#getSignature(java.lang.String)">getSignature</A></B>(java.lang.String type)</CODE><BR> Parse Java type such as "char", or "java.lang.String[]" and return the signature in byte code format, e.g.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -