⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stringbuffer.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#deleteCharAt(int)">deleteCharAt</A></B>(int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the character at the specified position in this <code>StringBuffer</code> (shortening the <code>StringBuffer</code> by one character).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#ensureCapacity(int)">ensureCapacity</A></B>(int&nbsp;minimumCapacity)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ensures that the capacity of the buffer is at least equal to the specified minimum.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#getChars(int, int, char[], int)">getChars</A></B>(int&nbsp;srcBegin,         int&nbsp;srcEnd,         char[]&nbsp;dst,         int&nbsp;dstBegin)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Characters are copied from this string buffer into the  destination character array <code>dst</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, boolean)">insert</A></B>(int&nbsp;offset,       boolean&nbsp;b)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>boolean</code>  argument into this string buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, char)">insert</A></B>(int&nbsp;offset,       char&nbsp;c)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>char</code>  argument into this string buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, char[])">insert</A></B>(int&nbsp;offset,       char[]&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>char</code> array  argument into this string buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, int)">insert</A></B>(int&nbsp;offset,       int&nbsp;i)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the second <code>int</code>  argument into this string buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, long)">insert</A></B>(int&nbsp;offset,       long&nbsp;l)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>long</code>  argument into this string buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, java.lang.Object)">insert</A></B>(int&nbsp;offset,       <A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>Object</code>  argument into this string buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, java.lang.String)">insert</A></B>(int&nbsp;offset,       <A HREF="../../java/lang/String.html">String</A>&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string into this string buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#length()">length</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the length (character count) of this string buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#reverse()">reverse</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The character sequence contained in this string buffer is  replaced by the reverse of the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#setCharAt(int, char)">setCharAt</A></B>(int&nbsp;index,          char&nbsp;ch)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The character at the specified index of this string buffer is set  to <code>ch</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#setLength(int)">setLength</A></B>(int&nbsp;newLength)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the length of this String buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#toString()">toString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts to a string representing the data in this string buffer.</TD>
</TR>
</TABLE>
&nbsp;<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.<A HREF="../../java/lang/Object.html">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<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="StringBuffer()"><!-- --></A><H3>
StringBuffer</H3>
<PRE>
public <B>StringBuffer</B>()</PRE>
<DL>
<DD>Constructs a string buffer with no characters in it and an  initial capacity of 16 characters.</DL>
<HR>

<A NAME="StringBuffer(int)"><!-- --></A><H3>
StringBuffer</H3>
<PRE>
public <B>StringBuffer</B>(int&nbsp;length)</PRE>
<DL>
<DD>Constructs a string buffer with no characters in it and an  initial capacity specified by the <code>length</code> argument.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>length</CODE> - the initial capacity.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NegativeArraySizeException.html">NegativeArraySizeException</A></CODE> - if the <code>length</code>               argument is less than <code>0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="StringBuffer(java.lang.String)"><!-- --></A><H3>
StringBuffer</H3>
<PRE>
public <B>StringBuffer</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;str)</PRE>
<DL>
<DD>Constructs a string buffer so that it represents the same  sequence of characters as the string argument; in other words, the initial contents of the string buffer is a copy of the  argument string. The initial capacity of the string buffer is  <code>16</code> plus the length of the string argument.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the initial contents of the buffer.</DL>
</DD>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="length()"><!-- --></A><H3>
length</H3>
<PRE>
public int <B>length</B>()</PRE>
<DL>
<DD>Returns the length (character count) of this string buffer.<DD><DL>
<DT><B>Returns:</B><DD>the length of the sequence of characters currently           represented by this string buffer.</DL>
</DD>
</DL>
<HR>

<A NAME="capacity()"><!-- --></A><H3>
capacity</H3>
<PRE>
public int <B>capacity</B>()</PRE>
<DL>
<DD>Returns the current capacity of the String buffer. The capacity is the amount of storage available for newly inserted characters; beyond which an allocation will occur.<DD><DL>
<DT><B>Returns:</B><DD>the current capacity of this string buffer.</DL>
</DD>
</DL>
<HR>

<A NAME="ensureCapacity(int)"><!-- --></A><H3>
ensureCapacity</H3>
<PRE>
public void <B>ensureCapacity</B>(int&nbsp;minimumCapacity)</PRE>
<DL>
<DD>Ensures that the capacity of the buffer is at least equal to the specified minimum. If the current capacity of this string buffer is less than the  argument, then a new internal buffer is allocated with greater  capacity. The new capacity is the larger of:  <ul> <li>The <code>minimumCapacity</code> argument.  <li>Twice the old capacity, plus <code>2</code>.  </ul> If the <code>minimumCapacity</code> argument is nonpositive, this method takes no action and simply returns.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>minimumCapacity</CODE> - the minimum desired capacity.</DL>
</DD>
</DL>
<HR>

<A NAME="setLength(int)"><!-- --></A><H3>
setLength</H3>
<PRE>
public void <B>setLength</B>(int&nbsp;newLength)</PRE>
<DL>
<DD>Sets the length of this String buffer. This string buffer is altered to represent a new character sequence  whose length is specified by the argument. For every nonnegative  index <i>k</i> less than <code>newLength</code>, the character at  index <i>k</i> in the new character sequence is the same as the  character at index <i>k</i> in the old sequence if <i>k</i> is less  than the length of the old character sequence; otherwise, it is the  null character <code>''</code>.    In other words, if the <code>newLength</code> argument is less than  the current length of the string buffer, the string buffer is  truncated to contain exactly the number of characters given by the  <code>newLength</code> argument.  <p> If the <code>newLength</code> argument is greater than or equal 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -