| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
| <!--NewPage-->
|
| <HTML>
|
| <HEAD>
|
| <!-- Generated by javadoc on Thu Nov 22 17:12:57 EST 2007 -->
|
| <TITLE>
|
| Xalan-Java 2.7.1: Class FastStringBuffer
|
| </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/FastStringBuffer.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/xml/utils/DOMHelper.html"><B>PREV CLASS</B></A>
|
| <A HREF="../../../../org/apache/xml/utils/Hashtree2Node.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="FastStringBuffer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: <A HREF="#field_detail">FIELD</A> | <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.xml.utils</FONT>
|
| <BR>
|
| Class FastStringBuffer</H2>
|
| <PRE>
|
| java.lang.Object
|
| |
|
| +--<B>org.apache.xml.utils.FastStringBuffer</B>
|
| </PRE>
|
| <HR>
|
| <DL>
|
| <DT>public class <B>FastStringBuffer</B><DT>extends java.lang.Object</DL>
|
|
|
| <P>
|
| Bare-bones, unsafe, fast string buffer. No thread-safety, no |
| parameter range checking, exposed fields. Note that in typical |
| applications, thread-safety of a StringBuffer is a somewhat |
| dubious concept in any case. |
| <p> |
| Note that Stree and DTM used a single FastStringBuffer as a string pool, |
| by recording start and length indices within this single buffer. This |
| minimizes heap overhead, but of course requires more work when retrieving |
| the data. |
| <p> |
| FastStringBuffer operates as a "chunked buffer". Doing so |
| reduces the need to recopy existing information when an append |
| exceeds the space available; we just allocate another chunk and |
| flow across to it. (The array of chunks may need to grow, |
| admittedly, but that's a much smaller object.) Some excess |
| recopying may arise when we extract Strings which cross chunk |
| boundaries; larger chunks make that less frequent. |
| <p> |
| The size values are parameterized, to allow tuning this code. In |
| theory, Result Tree Fragments might want to be tuned differently |
| from the main document's text. |
| <p> |
| %REVIEW% An experiment in self-tuning is |
| included in the code (using nested FastStringBuffers to achieve |
| variation in chunk sizes), but this implementation has proven to |
| be problematic when data may be being copied from the FSB into itself. |
| We should either re-architect that to make this safe (if possible) |
| or remove that code and clean up for performance/maintainability reasons. |
| <p>
|
| <P>
|
| <HR>
|
|
|
| <P>
|
| <!-- ======== INNER CLASS SUMMARY ======== -->
|
|
|
|
|
| <!-- =========== FIELD SUMMARY =========== -->
|
|
|
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Field Summary</B></FONT></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/xml/utils/FastStringBuffer.html#SUPPRESS_BOTH">SUPPRESS_BOTH</A></B></CODE>
|
|
|
| <BR>
|
| Manifest constant: Suppress both leading and trailing whitespace.</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/xml/utils/FastStringBuffer.html#SUPPRESS_LEADING_WS">SUPPRESS_LEADING_WS</A></B></CODE>
|
|
|
| <BR>
|
| Manifest constant: Suppress leading whitespace.</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/xml/utils/FastStringBuffer.html#SUPPRESS_TRAILING_WS">SUPPRESS_TRAILING_WS</A></B></CODE>
|
|
|
| <BR>
|
| Manifest constant: Suppress trailing whitespace.</TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <!-- ======== 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/xml/utils/FastStringBuffer.html#FastStringBuffer()">FastStringBuffer</A></B>()</CODE>
|
|
|
| <BR>
|
| Construct a FastStringBuffer, using a default allocation policy.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE><B><A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html#FastStringBuffer(int)">FastStringBuffer</A></B>(int initChunkBits)</CODE>
|
|
|
| <BR>
|
| Construct a FastStringBuffer, using default maxChunkBits and |
| rebundleBits values.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE><B><A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html#FastStringBuffer(int, int)">FastStringBuffer</A></B>(int initChunkBits, |
| int maxChunkBits)</CODE>
|
|
|
| <BR>
|
| Construct a FastStringBuffer, using a default rebundleBits value.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE><B><A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html#FastStringBuffer(int, int, int)">FastStringBuffer</A></B>(int initChunkBits, |
| int maxChunkBits, |
| int rebundleBits)</CODE>
|
|
|
| <BR>
|
| Construct a FastStringBuffer, with allocation policy as per parameters.</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/xml/utils/FastStringBuffer.html#append(char)">append</A></B>(char value)</CODE>
|
|
|
| <BR>
|
| Append a single character onto the FastStringBuffer, growing the |
| storage if necessary.</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/xml/utils/FastStringBuffer.html#append(char[], int, int)">append</A></B>(char[] chars, |
| int start, |
| int length)</CODE>
|
|
|
| <BR>
|
| Append part of the contents of a Character Array onto the |
| FastStringBuffer, growing the storage if necessary.</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/xml/utils/FastStringBuffer.html#append(org.apache.xml.utils.FastStringBuffer)">append</A></B>(<A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html">FastStringBuffer</A> value)</CODE>
|
|
|
| <BR>
|
| Append the contents of another FastStringBuffer onto |
| this FastStringBuffer, growing the storage if necessary.</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/xml/utils/FastStringBuffer.html#append(java.lang.String)">append</A></B>(java.lang.String value)</CODE>
|
|
|
| <BR>
|
| Append the contents of a String onto the FastStringBuffer, |
| growing the storage if necessary.</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/xml/utils/FastStringBuffer.html#append(java.lang.StringBuffer)">append</A></B>(java.lang.StringBuffer value)</CODE>
|
|
|
| <BR>
|
| Append the contents of a StringBuffer onto the FastStringBuffer, |
| growing the storage if necessary.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> char</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html#charAt(int)">charAt</A></B>(int pos)</CODE>
|
|
|
| <BR>
|
| Get a single character from the string buffer.</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/xml/utils/FastStringBuffer.html#getString(int, int)">getString</A></B>(int start, |
| int length)</CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> boolean</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html#isWhitespace(int, int)">isWhitespace</A></B>(int start, |
| int length)</CODE>
|
|
|
| <BR>
|
| </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/xml/utils/FastStringBuffer.html#length()">length</A></B>()</CODE>
|
|
|
| <BR>
|
| Get the length of the list.</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/xml/utils/FastStringBuffer.html#reset()">reset</A></B>()</CODE>
|
|
|
| <BR>
|
| Discard the content of the FastStringBuffer, and most of the memory |
| that was allocated by it, restoring the initial state.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html#sendNormalizedSAXcharacters(char[], int, int, org.xml.sax.ContentHandler)">sendNormalizedSAXcharacters</A></B>(char[] ch, |
| int start, |
| int length, |
| <A HREF="../../../../org/xml/sax/ContentHandler.html">ContentHandler</A> handler)</CODE>
|
|
|
| <BR>
|
| Directly normalize and dispatch the character array.</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/xml/utils/FastStringBuffer.html#sendNormalizedSAXcharacters(org.xml.sax.ContentHandler, int, int)">sendNormalizedSAXcharacters</A></B>(<A HREF="../../../../org/xml/sax/ContentHandler.html">ContentHandler</A> ch, |
| int start, |
| int length)</CODE>
|
|
|
| <BR>
|
| Sends the specified range of characters as one or more SAX characters() |
| events, normalizing the characters according to XSLT rules.</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/xml/utils/FastStringBuffer.html#sendSAXcharacters(org.xml.sax.ContentHandler, int, int)">sendSAXcharacters</A></B>(<A HREF="../../../../org/xml/sax/ContentHandler.html">ContentHandler</A> ch, |
| int start, |
| int length)</CODE>
|
|
|
| <BR>
|
| Sends the specified range of characters as one or more SAX characters() |
| events.</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/xml/utils/FastStringBuffer.html#sendSAXComment(org.xml.sax.ext.LexicalHandler, int, int)">sendSAXComment</A></B>(<A HREF="../../../../org/xml/sax/ext/LexicalHandler.html">LexicalHandler</A> ch, |
| int start, |
| int length)</CODE>
|
|
|
| <BR>
|
| Sends the specified range of characters as sax Comment.</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/xml/utils/FastStringBuffer.html#setLength(int)">setLength</A></B>(int l)</CODE>
|
|
|
| <BR>
|
| Directly set how much of the FastStringBuffer's storage is to be |
| considered part of its content.</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/xml/utils/FastStringBuffer.html#size()">size</A></B>()</CODE>
|
|
|
| <BR>
|
| Get the length of the list.</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/xml/utils/FastStringBuffer.html#toString()">toString</A></B>()</CODE>
|
|
|
| <BR>
|
| Note that this operation has been somewhat deoptimized by the shift to a |
| chunked array, as there is no factory method to produce a String object |
| directly from an array of arrays and hence a double copy is needed.</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>equals,
|
| getClass,
|
| hashCode,
|
| notify,
|
| notifyAll,
|
| wait,
|
| wait,
|
| wait</CODE></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <P>
|
|
|
| <!-- ============ FIELD DETAIL =========== -->
|
|
|
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Field Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="SUPPRESS_LEADING_WS"><!-- --></A><H3>
|
| SUPPRESS_LEADING_WS</H3>
|
| <PRE>
|
| public static final int <B>SUPPRESS_LEADING_WS</B></PRE>
|
| <DL>
|
| <DD>Manifest constant: Suppress leading whitespace. |
| This should be used when normalize-to-SAX is called for the first chunk of a |
| multi-chunk output, or one following unsuppressed whitespace in a previous |
| chunk.<DD><DL>
|
| <DT><B>See Also: </B><DD><A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html#sendNormalizedSAXcharacters(org.xml.sax.ContentHandler, int, int)"><CODE>sendNormalizedSAXcharacters(org.xml.sax.ContentHandler,int,int)</CODE></A></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="SUPPRESS_TRAILING_WS"><!-- --></A><H3>
|
| SUPPRESS_TRAILING_WS</H3>
|
| <PRE>
|
| public static final int <B>SUPPRESS_TRAILING_WS</B></PRE>
|
| <DL>
|
| <DD>Manifest constant: Suppress trailing whitespace. |
| This should be used when normalize-to-SAX is called for the last chunk of a |
| multi-chunk output; it may have to be or'ed with SUPPRESS_LEADING_WS.</DL>
|
| <HR>
|
|
|
| <A NAME="SUPPRESS_BOTH"><!-- --></A><H3>
|
| SUPPRESS_BOTH</H3>
|
| <PRE>
|
| public static final int <B>SUPPRESS_BOTH</B></PRE>
|
| <DL>
|
| <DD>Manifest constant: Suppress both leading and trailing whitespace. |
| This should be used when normalize-to-SAX is called for a complete string. |
| (I'm not wild about the name of this one. Ideas welcome.)<DD><DL>
|
| <DT><B>See Also: </B><DD><A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html#sendNormalizedSAXcharacters(org.xml.sax.ContentHandler, int, int)"><CODE>sendNormalizedSAXcharacters(org.xml.sax.ContentHandler,int,int)</CODE></A></DL>
|
| </DD>
|
| </DL>
|
|
|
| <!-- ========= 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="FastStringBuffer(int, int, int)"><!-- --></A><H3>
|
| FastStringBuffer</H3>
|
| <PRE>
|
| public <B>FastStringBuffer</B>(int initChunkBits, |
| int maxChunkBits, |
| int rebundleBits)</PRE>
|
| <DL>
|
| <DD>Construct a FastStringBuffer, with allocation policy as per parameters. |
| <p> |
| For coding convenience, I've expressed both allocation sizes in terms of |
| a number of bits. That's needed for the final size of a chunk, |
| to permit fast and efficient shift-and-mask addressing. It's less critical |
| for the inital size, and may be reconsidered. |
| <p> |
| An alternative would be to accept integer sizes and round to powers of two; |
| that really doesn't seem to buy us much, if anything.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>initChunkBits</CODE> - Length in characters of the initial allocation |
| of a chunk, expressed in log-base-2. (That is, 10 means allocate 1024 |
| characters.) Later chunks will use larger allocation units, to trade off |
| allocation speed of large document against storage efficiency of small |
| ones.<DD><CODE>maxChunkBits</CODE> - Number of character-offset bits that should be used for |
| addressing within a chunk. Maximum length of a chunk is 2^chunkBits |
| characters.<DD><CODE>rebundleBits</CODE> - Number of character-offset bits that addressing should |
| advance before we attempt to take a step from initChunkBits to maxChunkBits</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="FastStringBuffer(int, int)"><!-- --></A><H3>
|
| FastStringBuffer</H3>
|
| <PRE>
|
| public <B>FastStringBuffer</B>(int initChunkBits, |
| int maxChunkBits)</PRE>
|
| <DL>
|
| <DD>Construct a FastStringBuffer, using a default rebundleBits value. |
| |
| NEEDSDOC @param initChunkBits |
| NEEDSDOC @param maxChunkBits</DL>
|
| <HR>
|
|
|
| <A NAME="FastStringBuffer(int)"><!-- --></A><H3>
|
| FastStringBuffer</H3>
|
| <PRE>
|
| public <B>FastStringBuffer</B>(int initChunkBits)</PRE>
|
| <DL>
|
| <DD>Construct a FastStringBuffer, using default maxChunkBits and |
| rebundleBits values. |
| <p> |
| ISSUE: Should this call assert initial size, or fixed size? |
| Now configured as initial, with a default for fixed. |
| |
| NEEDSDOC @param initChunkBits</DL>
|
| <HR>
|
|
|
| <A NAME="FastStringBuffer()"><!-- --></A><H3>
|
| FastStringBuffer</H3>
|
| <PRE>
|
| public <B>FastStringBuffer</B>()</PRE>
|
| <DL>
|
| <DD>Construct a FastStringBuffer, using a default allocation policy.</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="size()"><!-- --></A><H3>
|
| size</H3>
|
| <PRE>
|
| public final int <B>size</B>()</PRE>
|
| <DL>
|
| <DD>Get the length of the list. Synonym for length().<DD><DL>
|
| <DT><B>Returns:</B><DD>the number of characters in the FastStringBuffer's content.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="length()"><!-- --></A><H3>
|
| length</H3>
|
| <PRE>
|
| public final int <B>length</B>()</PRE>
|
| <DL>
|
| <DD>Get the length of the list. Synonym for size().<DD><DL>
|
| <DT><B>Returns:</B><DD>the number of characters in the FastStringBuffer's content.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="reset()"><!-- --></A><H3>
|
| reset</H3>
|
| <PRE>
|
| public final void <B>reset</B>()</PRE>
|
| <DL>
|
| <DD>Discard the content of the FastStringBuffer, and most of the memory |
| that was allocated by it, restoring the initial state. Note that this |
| may eventually be different from setLength(0), which see.</DL>
|
| <HR>
|
|
|
| <A NAME="setLength(int)"><!-- --></A><H3>
|
| setLength</H3>
|
| <PRE>
|
| public final void <B>setLength</B>(int l)</PRE>
|
| <DL>
|
| <DD>Directly set how much of the FastStringBuffer's storage is to be |
| considered part of its content. This is a fast but hazardous |
| operation. It is not protected against negative values, or values |
| greater than the amount of storage currently available... and even |
| if additional storage does exist, its contents are unpredictable. |
| The only safe use for our setLength() is to truncate the FastStringBuffer |
| to a shorter string.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>l</CODE> - New length. If l<0 or l>=getLength(), this operation will |
| not report an error but future operations will almost certainly fail.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="toString()"><!-- --></A><H3>
|
| toString</H3>
|
| <PRE>
|
| public final java.lang.String <B>toString</B>()</PRE>
|
| <DL>
|
| <DD>Note that this operation has been somewhat deoptimized by the shift to a |
| chunked array, as there is no factory method to produce a String object |
| directly from an array of arrays and hence a double copy is needed. |
| By using ensureCapacity we hope to minimize the heap overhead of building |
| the intermediate StringBuffer. |
| <p> |
| (It really is a pity that Java didn't design String as a final subclass |
| of MutableString, rather than having StringBuffer be a separate hierarchy. |
| We'd avoid a <strong>lot</strong> of double-buffering.)<DD><DL>
|
| <DT><B>Returns:</B><DD>the contents of the FastStringBuffer as a standard Java string.<DT><B>Overrides:</B><DD>toString in class java.lang.Object</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="append(char)"><!-- --></A><H3>
|
| append</H3>
|
| <PRE>
|
| public final void <B>append</B>(char value)</PRE>
|
| <DL>
|
| <DD>Append a single character onto the FastStringBuffer, growing the |
| storage if necessary. |
| <p> |
| NOTE THAT after calling append(), previously obtained |
| references to m_array[][] may no longer be valid.... |
| though in fact they should be in this instance.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>value</CODE> - character to be appended.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="append(java.lang.String)"><!-- --></A><H3>
|
| append</H3>
|
| <PRE>
|
| public final void <B>append</B>(java.lang.String value)</PRE>
|
| <DL>
|
| <DD>Append the contents of a String onto the FastStringBuffer, |
| growing the storage if necessary. |
| <p> |
| NOTE THAT after calling append(), previously obtained |
| references to m_array[] may no longer be valid.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>value</CODE> - String whose contents are to be appended.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="append(java.lang.StringBuffer)"><!-- --></A><H3>
|
| append</H3>
|
| <PRE>
|
| public final void <B>append</B>(java.lang.StringBuffer value)</PRE>
|
| <DL>
|
| <DD>Append the contents of a StringBuffer onto the FastStringBuffer, |
| growing the storage if necessary. |
| <p> |
| NOTE THAT after calling append(), previously obtained |
| references to m_array[] may no longer be valid.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>value</CODE> - StringBuffer whose contents are to be appended.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="append(char[], int, int)"><!-- --></A><H3>
|
| append</H3>
|
| <PRE>
|
| public final void <B>append</B>(char[] chars, |
| int start, |
| int length)</PRE>
|
| <DL>
|
| <DD>Append part of the contents of a Character Array onto the |
| FastStringBuffer, growing the storage if necessary. |
| <p> |
| NOTE THAT after calling append(), previously obtained |
| references to m_array[] may no longer be valid.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>chars</CODE> - character array from which data is to be copied<DD><CODE>start</CODE> - offset in chars of first character to be copied, |
| zero-based.<DD><CODE>length</CODE> - number of characters to be copied</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="append(org.apache.xml.utils.FastStringBuffer)"><!-- --></A><H3>
|
| append</H3>
|
| <PRE>
|
| public final void <B>append</B>(<A HREF="../../../../org/apache/xml/utils/FastStringBuffer.html">FastStringBuffer</A> value)</PRE>
|
| <DL>
|
| <DD>Append the contents of another FastStringBuffer onto |
| this FastStringBuffer, growing the storage if necessary. |
| <p> |
| NOTE THAT after calling append(), previously obtained |
| references to m_array[] may no longer be valid.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>value</CODE> - FastStringBuffer whose contents are |
| to be appended.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="isWhitespace(int, int)"><!-- --></A><H3>
|
| isWhitespace</H3>
|
| <PRE>
|
| public boolean <B>isWhitespace</B>(int start, |
| int length)</PRE>
|
| <DL>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>start</CODE> - Offset of first character in the range.<DD><CODE>length</CODE> - Number of characters to send.<DT><B>Returns:</B><DD>true if the specified range of characters are all whitespace, |
| as defined by XMLCharacterRecognizer. |
| <p> |
| CURRENTLY DOES NOT CHECK FOR OUT-OF-RANGE.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getString(int, int)"><!-- --></A><H3>
|
| getString</H3>
|
| <PRE>
|
| public java.lang.String <B>getString</B>(int start, |
| int length)</PRE>
|
| <DL>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>start</CODE> - Offset of first character in the range.<DD><CODE>length</CODE> - Number of characters to send.<DT><B>Returns:</B><DD>a new String object initialized from the specified range of |
| characters.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="charAt(int)"><!-- --></A><H3>
|
| charAt</H3>
|
| <PRE>
|
| public char <B>charAt</B>(int pos)</PRE>
|
| <DL>
|
| <DD>Get a single character from the string buffer.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>pos</CODE> - character position requested.<DT><B>Returns:</B><DD>A character from the requested position.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="sendSAXcharacters(org.xml.sax.ContentHandler, int, int)"><!-- --></A><H3>
|
| sendSAXcharacters</H3>
|
| <PRE>
|
| public void <B>sendSAXcharacters</B>(<A HREF="../../../../org/xml/sax/ContentHandler.html">ContentHandler</A> ch, |
| int start, |
| int length) |
| throws <A HREF="../../../../org/xml/sax/SAXException.html">SAXException</A></PRE>
|
| <DL>
|
| <DD>Sends the specified range of characters as one or more SAX characters() |
| events. |
| Note that the buffer reference passed to the ContentHandler may be |
| invalidated if the FastStringBuffer is edited; it's the user's |
| responsibility to manage access to the FastStringBuffer to prevent this |
| problem from arising. |
| <p> |
| Note too that there is no promise that the output will be sent as a |
| single call. As is always true in SAX, one logical string may be split |
| across multiple blocks of memory and hence delivered as several |
| successive events.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>ch</CODE> - SAX ContentHandler object to receive the event.<DD><CODE>start</CODE> - Offset of first character in the range.<DD><CODE>length</CODE> - Number of characters to send.<DT><B>Throws:</B><DD><A HREF="../../../../org/xml/sax/SAXException.html">SAXException</A> - may be thrown by handler's |
| characters() method.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="sendNormalizedSAXcharacters(org.xml.sax.ContentHandler, int, int)"><!-- --></A><H3>
|
| sendNormalizedSAXcharacters</H3>
|
| <PRE>
|
| public int <B>sendNormalizedSAXcharacters</B>(<A HREF="../../../../org/xml/sax/ContentHandler.html">ContentHandler</A> ch, |
| int start, |
| int length) |
| throws <A HREF="../../../../org/xml/sax/SAXException.html">SAXException</A></PRE>
|
| <DL>
|
| <DD>Sends the specified range of characters as one or more SAX characters() |
| events, normalizing the characters according to XSLT rules.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>ch</CODE> - SAX ContentHandler object to receive the event.<DD><CODE>start</CODE> - Offset of first character in the range.<DD><CODE>length</CODE> - Number of characters to send.<DT><B>Returns:</B><DD>normalization status to apply to next chunk (because we may |
| have been called recursively to process an inner FSB): |
| <dl> |
| <dt>0</dt> |
| <dd>if this output did not end in retained whitespace, and thus whitespace |
| at the start of the following chunk (if any) should be converted to a |
| single space. |
| <dt>SUPPRESS_LEADING_WS</dt> |
| <dd>if this output ended in retained whitespace, and thus whitespace |
| at the start of the following chunk (if any) should be completely |
| suppressed.</dd> |
| </dd> |
| </dl><DT><B>Throws:</B><DD><A HREF="../../../../org/xml/sax/SAXException.html">SAXException</A> - may be thrown by handler's |
| characters() method.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="sendNormalizedSAXcharacters(char[], int, int, org.xml.sax.ContentHandler)"><!-- --></A><H3>
|
| sendNormalizedSAXcharacters</H3>
|
| <PRE>
|
| public static void <B>sendNormalizedSAXcharacters</B>(char[] ch, |
| int start, |
| int length, |
| <A HREF="../../../../org/xml/sax/ContentHandler.html">ContentHandler</A> handler) |
| throws <A HREF="../../../../org/xml/sax/SAXException.html">SAXException</A></PRE>
|
| <DL>
|
| <DD>Directly normalize and dispatch the character array.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>ch</CODE> - The characters from the XML document.<DD><CODE>start</CODE> - The start position in the array.<DD><CODE>length</CODE> - The number of characters to read from the array.<DD><CODE>handler</CODE> - SAX ContentHandler object to receive the event.<DT><B>Throws:</B><DD><A HREF="../../../../org/xml/sax/SAXException.html">SAXException</A> - Any SAX exception, possibly |
| wrapping another exception.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="sendSAXComment(org.xml.sax.ext.LexicalHandler, int, int)"><!-- --></A><H3>
|
| sendSAXComment</H3>
|
| <PRE>
|
| public void <B>sendSAXComment</B>(<A HREF="../../../../org/xml/sax/ext/LexicalHandler.html">LexicalHandler</A> ch, |
| int start, |
| int length) |
| throws <A HREF="../../../../org/xml/sax/SAXException.html">SAXException</A></PRE>
|
| <DL>
|
| <DD>Sends the specified range of characters as sax Comment. |
| <p> |
| Note that, unlike sendSAXcharacters, this has to be done as a single |
| call to LexicalHandler#comment.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>ch</CODE> - SAX LexicalHandler object to receive the event.<DD><CODE>start</CODE> - Offset of first character in the range.<DD><CODE>length</CODE> - Number of characters to send.<DT><B>Throws:</B><DD><A HREF="../../../../org/xml/sax/SAXException.html">SAXException</A> - may be thrown by handler's |
| characters() method.</DL>
|
| </DD>
|
| </DL>
|
| <!-- ========= END OF CLASS DATA ========= -->
|
| <HR>
|
|
|
| <!-- ========== START OF NAVBAR ========== -->
|
| <A NAME="navbar_bottom"><!-- --></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
|
| <TR>
|
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
| <A NAME="navbar_bottom_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/FastStringBuffer.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/xml/utils/DOMHelper.html"><B>PREV CLASS</B></A>
|
| <A HREF="../../../../org/apache/xml/utils/Hashtree2Node.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="FastStringBuffer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <!-- =========== END OF NAVBAR =========== -->
|
|
|
| <HR>
|
| Copyright © 2006 Apache XML Project. All Rights Reserved.
|
| </BODY>
|
| </HTML>
|