1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.6.0_03) on Mon Mar 23 17:06:56 EDT 2009 -->
6<TITLE>
7Rope
8</TITLE>
9
10<META NAME="date" CONTENT="2009-03-23">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="/stylesheet.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    if (location.href.indexOf('is-external=true') == -1) {
18        parent.document.title="Rope";
19    }
20}
21</SCRIPT>
22<NOSCRIPT>
23</NOSCRIPT>
24
25</HEAD>
26
27<BODY BGCOLOR="white" onload="windowTitle();">
28<HR>
29
30
31<!-- ========= START OF TOP NAVBAR ======= -->
32<A NAME="navbar_top"><!-- --></A>
33<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35<TR>
36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37<A NAME="navbar_top_firstrow"><!-- --></A>
38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39  <TR ALIGN="center" VALIGN="top">
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
47  </TR>
48</TABLE>
49</TD>
50<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
51</EM>
52</TD>
53</TR>
54
55<TR>
56<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57&nbsp;PREV CLASS&nbsp;
58&nbsp;<A HREF="/org/ahmadsoft/ropes/RopeBuilder.html" title="class in org.ahmadsoft.ropes"><B>NEXT CLASS</B></A></FONT></TD>
59<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
60  <A HREF="/index.html?org/ahmadsoft/ropes/Rope.html" target="_top"><B>FRAMES</B></A>  &nbsp;
61&nbsp;<A HREF="Rope.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
62&nbsp;<SCRIPT type="text/javascript">
63  <!--
64  if(window==top) {
65    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
66  }
67  //-->
68</SCRIPT>
69<NOSCRIPT>
70  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
71</NOSCRIPT>
72
73
74</FONT></TD>
75</TR>
76<TR>
77<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
78  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
79<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
80DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
81</TR>
82</TABLE>
83<A NAME="skip-navbar_top"></A>
84<!-- ========= END OF TOP NAVBAR ========= -->
85
86<HR>
87<!-- ======== START OF CLASS DATA ======== -->
88<H2>
89<FONT SIZE="-1">
90org.ahmadsoft.ropes</FONT>
91<BR>
92Interface Rope</H2>
93<DL>
94<DT><B>All Superinterfaces:</B> <DD>java.lang.CharSequence, java.lang.Comparable&lt;java.lang.CharSequence&gt;, java.lang.Iterable&lt;java.lang.Character&gt;, java.io.Serializable</DD>
95</DL>
96<DL>
97<DT><B>All Known Implementing Classes:</B> <DD><A HREF="/org/ahmadsoft/ropes/impl/AbstractRope.html" title="class in org.ahmadsoft.ropes.impl">AbstractRope</A>, <A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRope.html" title="class in org.ahmadsoft.ropes.impl">ConcatenationRope</A>, <A HREF="/org/ahmadsoft/ropes/impl/FlatCharArrayRope.html" title="class in org.ahmadsoft.ropes.impl">FlatCharArrayRope</A>, <A HREF="/org/ahmadsoft/ropes/impl/FlatCharSequenceRope.html" title="class in org.ahmadsoft.ropes.impl">FlatCharSequenceRope</A>, <A HREF="/org/ahmadsoft/ropes/impl/ReverseRope.html" title="class in org.ahmadsoft.ropes.impl">ReverseRope</A>, <A HREF="/org/ahmadsoft/ropes/impl/SubstringRope.html" title="class in org.ahmadsoft.ropes.impl">SubstringRope</A></DD>
98</DL>
99<HR>
100<DL>
101<DT><PRE>public interface <B>Rope</B><DT>extends java.lang.CharSequence, java.lang.Iterable&lt;java.lang.Character&gt;, java.lang.Comparable&lt;java.lang.CharSequence&gt;, java.io.Serializable</DL>
102</PRE>
103
104<P>
105<p>
106 A rope represents character strings. Ropes are immutable which
107 means that once they are created, they cannot be changed. This
108 makes them suitable for sharing in multi-threaded environments.
109 </p><p>
110 Rope operations, unlike string operations, scale well to very
111 long character strings. Most mutation operations run in O(log n)
112 time or better. However, random-access character retrieval is
113 generally slower than for a String. By traversing consecutive
114 characters with an iterator instead, performance improves to
115 O(1).
116 </p><p>
117 This rope implementation implements all performance optimizations
118 outlined in "<a href="http://www.cs.ubc.ca/local/reading/proceedings/spe91-95/spe/vol25/issue12/spe986.pdf">Ropes: an Alternative to Strings</a>"
119 by Hans-J. Boehm, Russ Atkinson and Michael Plass, including,
120 notably, deferred evaluation of long substrings and automatic
121 rebalancing.
122 </p>
123 <h4>Immutability (a Caveat)</h4>
124 A rope is immutable. Specifically, calling any mutator function
125 on a rope always returns a modified copy; the original rope is
126 left untouched. However, care must be taken to build ropes from
127 immutable <code>CharSequences</code> such as <code>Strings</code>,
128 or else from mutable <code>CharSequences</code> that your program
129 <emph>guarantees will not change</emph>. Failure to do so will result in
130 logic errors.
131<P>
132
133<P>
134<DL>
135<DT><B>Author:</B></DT>
136  <DD>Amin Ahmad</DD>
137</DL>
138<HR>
139
140<P>
141<!-- =========== FIELD SUMMARY =========== -->
142
143<A NAME="field_summary"><!-- --></A>
144<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
145<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
146<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
147<B>Field Summary</B></FONT></TH>
148</TR>
149<TR BGCOLOR="white" CLASS="TableRowColor">
150<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
151<CODE>static&nbsp;<A HREF="/org/ahmadsoft/ropes/RopeBuilder.html" title="class in org.ahmadsoft.ropes">RopeBuilder</A></CODE></FONT></TD>
152<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#BUILDER">BUILDER</A></B></CODE>
153
154<BR>
155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A factory used for constructing ropes.</TD>
156</TR>
157</TABLE>
158&nbsp;
159<!-- ========== METHOD SUMMARY =========== -->
160
161<A NAME="method_summary"><!-- --></A>
162<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
163<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
164<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
165<B>Method Summary</B></FONT></TH>
166</TR>
167<TR BGCOLOR="white" CLASS="TableRowColor">
168<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
169<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
170<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#append(char)">append</A></B>(char&nbsp;c)</CODE>
171
172<BR>
173&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new rope created by appending the specified character to
174 this rope.</TD>
175</TR>
176<TR BGCOLOR="white" CLASS="TableRowColor">
177<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
178<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
179<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#append(java.lang.CharSequence)">append</A></B>(java.lang.CharSequence&nbsp;suffix)</CODE>
180
181<BR>
182&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new rope created by appending the specified character sequence to
183 this rope.</TD>
184</TR>
185<TR BGCOLOR="white" CLASS="TableRowColor">
186<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
187<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
188<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#append(java.lang.CharSequence, int, int)">append</A></B>(java.lang.CharSequence&nbsp;csq,
189       int&nbsp;start,
190       int&nbsp;end)</CODE>
191
192<BR>
193&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new rope created by appending the specified character range to
194 this rope.</TD>
195</TR>
196<TR BGCOLOR="white" CLASS="TableRowColor">
197<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
198<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
199<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#delete(int, int)">delete</A></B>(int&nbsp;start,
200       int&nbsp;end)</CODE>
201
202<BR>
203&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creats a new rope by delete the specified character substring.</TD>
204</TR>
205<TR BGCOLOR="white" CLASS="TableRowColor">
206<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
207<CODE>&nbsp;boolean</CODE></FONT></TD>
208<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#endsWith(java.lang.CharSequence)">endsWith</A></B>(java.lang.CharSequence&nbsp;suffix)</CODE>
209
210<BR>
211&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if this rope ends with the specified 
212 suffix.</TD>
213</TR>
214<TR BGCOLOR="white" CLASS="TableRowColor">
215<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
216<CODE>&nbsp;boolean</CODE></FONT></TD>
217<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#endsWith(java.lang.CharSequence, int)">endsWith</A></B>(java.lang.CharSequence&nbsp;suffix,
218         int&nbsp;offset)</CODE>
219
220<BR>
221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if this rope, terminated at a specified
222 offset, ends with the specified suffix.</TD>
223</TR>
224<TR BGCOLOR="white" CLASS="TableRowColor">
225<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
226<CODE>&nbsp;int</CODE></FONT></TD>
227<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#indexOf(char)">indexOf</A></B>(char&nbsp;ch)</CODE>
228
229<BR>
230&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index within this rope of the first occurrence of the
231 specified character.</TD>
232</TR>
233<TR BGCOLOR="white" CLASS="TableRowColor">
234<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
235<CODE>&nbsp;int</CODE></FONT></TD>
236<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#indexOf(char, int)">indexOf</A></B>(char&nbsp;ch,
237        int&nbsp;fromIndex)</CODE>
238
239<BR>
240&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index within this rope of the first occurrence of the
241 specified character, beginning at the specified index.</TD>
242</TR>
243<TR BGCOLOR="white" CLASS="TableRowColor">
244<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
245<CODE>&nbsp;int</CODE></FONT></TD>
246<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#indexOf(java.lang.CharSequence)">indexOf</A></B>(java.lang.CharSequence&nbsp;sequence)</CODE>
247
248<BR>
249&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index within this rope of the first occurrence of the
250 specified string.</TD>
251</TR>
252<TR BGCOLOR="white" CLASS="TableRowColor">
253<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
254<CODE>&nbsp;int</CODE></FONT></TD>
255<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#indexOf(java.lang.CharSequence, int)">indexOf</A></B>(java.lang.CharSequence&nbsp;sequence,
256        int&nbsp;fromIndex)</CODE>
257
258<BR>
259&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index within this rope of the first occurrence of the
260 specified string, beginning at the specified index.</TD>
261</TR>
262<TR BGCOLOR="white" CLASS="TableRowColor">
263<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
264<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
265<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#insert(int, java.lang.CharSequence)">insert</A></B>(int&nbsp;dstOffset,
266       java.lang.CharSequence&nbsp;s)</CODE>
267
268<BR>
269&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new rope by inserting the specified <code>CharSequence</code>
270 into this rope.</TD>
271</TR>
272<TR BGCOLOR="white" CLASS="TableRowColor">
273<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
274<CODE>&nbsp;boolean</CODE></FONT></TD>
275<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#isEmpty()">isEmpty</A></B>()</CODE>
276
277<BR>
278&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if and only if the length of this rope is zero.</TD>
279</TR>
280<TR BGCOLOR="white" CLASS="TableRowColor">
281<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
282<CODE>&nbsp;java.util.Iterator&lt;java.lang.Character&gt;</CODE></FONT></TD>
283<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#iterator(int)">iterator</A></B>(int&nbsp;start)</CODE>
284
285<BR>
286&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an iterator positioned to start at the specified index.</TD>
287</TR>
288<TR BGCOLOR="white" CLASS="TableRowColor">
289<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
290<CODE>&nbsp;java.util.regex.Matcher</CODE></FONT></TD>
291<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#matcher(java.util.regex.Pattern)">matcher</A></B>(java.util.regex.Pattern&nbsp;pattern)</CODE>
292
293<BR>
294&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a matcher that will match this rope against the
295 specified pattern.</TD>
296</TR>
297<TR BGCOLOR="white" CLASS="TableRowColor">
298<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
299<CODE>&nbsp;boolean</CODE></FONT></TD>
300<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#matches(java.util.regex.Pattern)">matches</A></B>(java.util.regex.Pattern&nbsp;regex)</CODE>
301
302<BR>
303&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if this rope matches the specified
304 <code>Pattern</code>, or <code>false</code> otherwise.</TD>
305</TR>
306<TR BGCOLOR="white" CLASS="TableRowColor">
307<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
308<CODE>&nbsp;boolean</CODE></FONT></TD>
309<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#matches(java.lang.String)">matches</A></B>(java.lang.String&nbsp;regex)</CODE>
310
311<BR>
312&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if this rope matches the specified
313 regular expression, or <code>false</code> otherwise.</TD>
314</TR>
315<TR BGCOLOR="white" CLASS="TableRowColor">
316<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
317<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
318<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#padEnd(int)">padEnd</A></B>(int&nbsp;toLength)</CODE>
319
320<BR>
321&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Increase the length of this rope to the specified length by appending
322 spaces to this rope.</TD>
323</TR>
324<TR BGCOLOR="white" CLASS="TableRowColor">
325<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
326<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
327<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#padEnd(int, char)">padEnd</A></B>(int&nbsp;toLength,
328       char&nbsp;padChar)</CODE>
329
330<BR>
331&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Increase the length of this rope to the specified length by repeatedly 
332 appending the specified character to this rope.</TD>
333</TR>
334<TR BGCOLOR="white" CLASS="TableRowColor">
335<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
336<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
337<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#padStart(int)">padStart</A></B>(int&nbsp;toLength)</CODE>
338
339<BR>
340&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Increase the length of this rope to the specified length by prepending 
341 spaces to this rope.</TD>
342</TR>
343<TR BGCOLOR="white" CLASS="TableRowColor">
344<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
345<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
346<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#padStart(int, char)">padStart</A></B>(int&nbsp;toLength,
347         char&nbsp;padChar)</CODE>
348
349<BR>
350&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Increase the length of this rope to the specified length by repeatedly 
351 prepending the specified character to this rope.</TD>
352</TR>
353<TR BGCOLOR="white" CLASS="TableRowColor">
354<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
355<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
356<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#rebalance()">rebalance</A></B>()</CODE>
357
358<BR>
359&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rebalances the current rope, returning the rebalanced rope.</TD>
360</TR>
361<TR BGCOLOR="white" CLASS="TableRowColor">
362<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
363<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
364<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#reverse()">reverse</A></B>()</CODE>
365
366<BR>
367&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reverses this rope.</TD>
368</TR>
369<TR BGCOLOR="white" CLASS="TableRowColor">
370<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
371<CODE>&nbsp;java.util.Iterator&lt;java.lang.Character&gt;</CODE></FONT></TD>
372<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#reverseIterator()">reverseIterator</A></B>()</CODE>
373
374<BR>
375&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a reverse iterator positioned to start at the end of this
376 rope.</TD>
377</TR>
378<TR BGCOLOR="white" CLASS="TableRowColor">
379<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
380<CODE>&nbsp;java.util.Iterator&lt;java.lang.Character&gt;</CODE></FONT></TD>
381<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#reverseIterator(int)">reverseIterator</A></B>(int&nbsp;start)</CODE>
382
383<BR>
384&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a reverse iterator positioned to start at the specified index.</TD>
385</TR>
386<TR BGCOLOR="white" CLASS="TableRowColor">
387<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
388<CODE>&nbsp;boolean</CODE></FONT></TD>
389<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#startsWith(java.lang.CharSequence)">startsWith</A></B>(java.lang.CharSequence&nbsp;prefix)</CODE>
390
391<BR>
392&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if this rope starts with the specified 
393 prefix.</TD>
394</TR>
395<TR BGCOLOR="white" CLASS="TableRowColor">
396<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
397<CODE>&nbsp;boolean</CODE></FONT></TD>
398<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#startsWith(java.lang.CharSequence, int)">startsWith</A></B>(java.lang.CharSequence&nbsp;prefix,
399           int&nbsp;offset)</CODE>
400
401<BR>
402&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if this rope, beginning from a specified
403 offset, starts with the specified prefix.</TD>
404</TR>
405<TR BGCOLOR="white" CLASS="TableRowColor">
406<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
407<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
408<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#subSequence(int, int)">subSequence</A></B>(int&nbsp;start,
409            int&nbsp;end)</CODE>
410
411<BR>
412&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
413</TR>
414<TR BGCOLOR="white" CLASS="TableRowColor">
415<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
416<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
417<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#trim()">trim</A></B>()</CODE>
418
419<BR>
420&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Trims all whitespace as well as characters less than <code>0x20</code> from
421 the beginning and end of this string.</TD>
422</TR>
423<TR BGCOLOR="white" CLASS="TableRowColor">
424<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
425<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
426<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#trimEnd()">trimEnd</A></B>()</CODE>
427
428<BR>
429&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Trims all whitespace as well as characters less than <code>0x20</code> from
430 the end of this rope.</TD>
431</TR>
432<TR BGCOLOR="white" CLASS="TableRowColor">
433<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
434<CODE>&nbsp;<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A></CODE></FONT></TD>
435<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#trimStart()">trimStart</A></B>()</CODE>
436
437<BR>
438&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Trims all whitespace as well as characters less than 0x20 from
439 the beginning of this string.</TD>
440</TR>
441<TR BGCOLOR="white" CLASS="TableRowColor">
442<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
443<CODE>&nbsp;void</CODE></FONT></TD>
444<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#write(java.io.Writer)">write</A></B>(java.io.Writer&nbsp;out)</CODE>
445
446<BR>
447&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write this rope to a <code>Writer</code>.</TD>
448</TR>
449<TR BGCOLOR="white" CLASS="TableRowColor">
450<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
451<CODE>&nbsp;void</CODE></FONT></TD>
452<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/Rope.html#write(java.io.Writer, int, int)">write</A></B>(java.io.Writer&nbsp;out,
453      int&nbsp;offset,
454      int&nbsp;length)</CODE>
455
456<BR>
457&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write a range of this rope to a <code>Writer</code>.</TD>
458</TR>
459</TABLE>
460&nbsp;<A NAME="methods_inherited_from_class_java.lang.CharSequence"><!-- --></A>
461<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
462<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
463<TH ALIGN="left"><B>Methods inherited from interface java.lang.CharSequence</B></TH>
464</TR>
465<TR BGCOLOR="white" CLASS="TableRowColor">
466<TD><CODE>charAt, length, toString</CODE></TD>
467</TR>
468</TABLE>
469&nbsp;<A NAME="methods_inherited_from_class_java.lang.Iterable"><!-- --></A>
470<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
471<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
472<TH ALIGN="left"><B>Methods inherited from interface java.lang.Iterable</B></TH>
473</TR>
474<TR BGCOLOR="white" CLASS="TableRowColor">
475<TD><CODE>iterator</CODE></TD>
476</TR>
477</TABLE>
478&nbsp;<A NAME="methods_inherited_from_class_java.lang.Comparable"><!-- --></A>
479<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
480<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
481<TH ALIGN="left"><B>Methods inherited from interface java.lang.Comparable</B></TH>
482</TR>
483<TR BGCOLOR="white" CLASS="TableRowColor">
484<TD><CODE>compareTo</CODE></TD>
485</TR>
486</TABLE>
487&nbsp;
488<P>
489
490<!-- ============ FIELD DETAIL =========== -->
491
492<A NAME="field_detail"><!-- --></A>
493<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
494<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
495<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
496<B>Field Detail</B></FONT></TH>
497</TR>
498</TABLE>
499
500<A NAME="BUILDER"><!-- --></A><H3>
501BUILDER</H3>
502<PRE>
503static final <A HREF="/org/ahmadsoft/ropes/RopeBuilder.html" title="class in org.ahmadsoft.ropes">RopeBuilder</A> <B>BUILDER</B></PRE>
504<DL>
505<DD>A factory used for constructing ropes.
506<P>
507<DL>
508</DL>
509</DL>
510
511<!-- ============ METHOD DETAIL ========== -->
512
513<A NAME="method_detail"><!-- --></A>
514<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
515<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
516<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
517<B>Method Detail</B></FONT></TH>
518</TR>
519</TABLE>
520
521<A NAME="append(char)"><!-- --></A><H3>
522append</H3>
523<PRE>
524<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>append</B>(char&nbsp;c)</PRE>
525<DL>
526<DD>Returns a new rope created by appending the specified character to
527 this rope.
528<P>
529<DD><DL>
530</DL>
531</DD>
532<DD><DL>
533<DT><B>Parameters:</B><DD><CODE>c</CODE> - the specified character.
534<DT><B>Returns:</B><DD>a new rope.</DL>
535</DD>
536</DL>
537<HR>
538
539<A NAME="append(java.lang.CharSequence)"><!-- --></A><H3>
540append</H3>
541<PRE>
542<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>append</B>(java.lang.CharSequence&nbsp;suffix)</PRE>
543<DL>
544<DD>Returns a new rope created by appending the specified character sequence to
545 this rope.
546<P>
547<DD><DL>
548</DL>
549</DD>
550<DD><DL>
551<DT><B>Parameters:</B><DD><CODE>suffix</CODE> - the specified suffix.
552<DT><B>Returns:</B><DD>a new rope.</DL>
553</DD>
554</DL>
555<HR>
556
557<A NAME="append(java.lang.CharSequence, int, int)"><!-- --></A><H3>
558append</H3>
559<PRE>
560<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>append</B>(java.lang.CharSequence&nbsp;csq,
561            int&nbsp;start,
562            int&nbsp;end)</PRE>
563<DL>
564<DD>Returns a new rope created by appending the specified character range to
565 this rope.
566<P>
567<DD><DL>
568</DL>
569</DD>
570<DD><DL>
571<DT><B>Parameters:</B><DD><CODE>csq</CODE> - the specified character.<DD><CODE>start</CODE> - the start index, inclusive.<DD><CODE>end</CODE> - the end index, non-inclusive.
572<DT><B>Returns:</B><DD>a new rope.</DL>
573</DD>
574</DL>
575<HR>
576
577<A NAME="delete(int, int)"><!-- --></A><H3>
578delete</H3>
579<PRE>
580<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>delete</B>(int&nbsp;start,
581            int&nbsp;end)</PRE>
582<DL>
583<DD>Creats a new rope by delete the specified character substring.
584 The substring begins at the specified <code>start</code> and extends to
585 the character at index <code>end - 1</code> or to the end of the
586 sequence if no such character exists. If
587 <code>start</code> is equal to <code>end</code>, no changes are made.
588<P>
589<DD><DL>
590</DL>
591</DD>
592<DD><DL>
593<DT><B>Parameters:</B><DD><CODE>start</CODE> - The beginning index, inclusive.<DD><CODE>end</CODE> - The ending index, exclusive.
594<DT><B>Returns:</B><DD>This object.
595<DT><B>Throws:</B>
596<DD><CODE>java.lang.StringIndexOutOfBoundsException</CODE> - if <code>start</code>
597             is negative, greater than <code>length()</code>, or
598                   greater than <code>end</code>.</DL>
599</DD>
600</DL>
601<HR>
602
603<A NAME="indexOf(char)"><!-- --></A><H3>
604indexOf</H3>
605<PRE>
606int <B>indexOf</B>(char&nbsp;ch)</PRE>
607<DL>
608<DD>Returns the index within this rope of the first occurrence of the
609 specified character. If a character with value <code>ch</code> occurs
610 in the character sequence represented by this <code>Rope</code>
611 object, then the index of the first such occurrence is returned --
612 that is, the smallest value k such that:
613 <p>
614 <code>this.charAt(k) == ch</code>
615 <p>
616 is <code>true</code>. If no such character occurs in this string, then
617 <code>-1</code> is returned.
618<P>
619<DD><DL>
620</DL>
621</DD>
622<DD><DL>
623<DT><B>Parameters:</B><DD><CODE>ch</CODE> - a character.
624<DT><B>Returns:</B><DD>the index of the first occurrence of the character in the character
625 sequence represented by this object, or <code>-1</code> if the character
626 does not occur.</DL>
627</DD>
628</DL>
629<HR>
630
631<A NAME="indexOf(char, int)"><!-- --></A><H3>
632indexOf</H3>
633<PRE>
634int <B>indexOf</B>(char&nbsp;ch,
635            int&nbsp;fromIndex)</PRE>
636<DL>
637<DD>Returns the index within this rope of the first occurrence of the
638 specified character, beginning at the specified index. If a character
639 with value <code>ch</code> occurs in the character sequence
640 represented by this <code>Rope</code> object, then the index of the
641 first such occurrence is returned&#8212;that is, the smallest value k
642 such that:
643 <p>
644 <code>this.charAt(k) == ch</code>
645 <p>
646 is <code>true</code>. If no such character occurs in this string, then
647 <code>-1</code> is returned.
648<P>
649<DD><DL>
650</DL>
651</DD>
652<DD><DL>
653<DT><B>Parameters:</B><DD><CODE>ch</CODE> - a character.<DD><CODE>fromIndex</CODE> - the index to start searching from.
654<DT><B>Returns:</B><DD>the index of the first occurrence of the character in the character
655 sequence represented by this object, or -1 if the character does not occur.</DL>
656</DD>
657</DL>
658<HR>
659
660<A NAME="indexOf(java.lang.CharSequence)"><!-- --></A><H3>
661indexOf</H3>
662<PRE>
663int <B>indexOf</B>(java.lang.CharSequence&nbsp;sequence)</PRE>
664<DL>
665<DD>Returns the index within this rope of the first occurrence of the
666 specified string. The value returned is the smallest <i>k</i> such
667 that:
668 <pre>
669     this.startsWith(str, k)
670 </pre>
671 If no such <i>k</i> exists, then -1 is returned.
672<P>
673<DD><DL>
674</DL>
675</DD>
676<DD><DL>
677<DT><B>Parameters:</B><DD><CODE>sequence</CODE> - the string to find.
678<DT><B>Returns:</B><DD>the index of the first occurrence of the specified string, or
679 -1 if the specified string does not occur.</DL>
680</DD>
681</DL>
682<HR>
683
684<A NAME="indexOf(java.lang.CharSequence, int)"><!-- --></A><H3>
685indexOf</H3>
686<PRE>
687int <B>indexOf</B>(java.lang.CharSequence&nbsp;sequence,
688            int&nbsp;fromIndex)</PRE>
689<DL>
690<DD>Returns the index within this rope of the first occurrence of the
691 specified string, beginning at the specified index. The value returned
692 is the smallest <i>k</i> such that:
693 <pre>
694     k >= fromIndex && this.startsWith(str, k)
695 </pre>
696 If no such <i>k</i> exists, then -1 is returned.
697<P>
698<DD><DL>
699</DL>
700</DD>
701<DD><DL>
702<DT><B>Parameters:</B><DD><CODE>sequence</CODE> - the string to find.<DD><CODE>fromIndex</CODE> - the index to start searching from.
703<DT><B>Returns:</B><DD>the index of the first occurrence of the specified string, or
704 -1 if the specified string does not occur.</DL>
705</DD>
706</DL>
707<HR>
708
709<A NAME="insert(int, java.lang.CharSequence)"><!-- --></A><H3>
710insert</H3>
711<PRE>
712<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>insert</B>(int&nbsp;dstOffset,
713            java.lang.CharSequence&nbsp;s)</PRE>
714<DL>
715<DD>Creates a new rope by inserting the specified <code>CharSequence</code>
716 into this rope.
717 <p>
718 The characters of the <code>CharSequence</code> argument are inserted,
719 in order, into this rope at the indicated offset.
720
721 <p>If <code>s</code> is <code>null</code>, then the four characters
722 <code>"null"</code> are inserted into this sequence.
723<P>
724<DD><DL>
725</DL>
726</DD>
727<DD><DL>
728<DT><B>Parameters:</B><DD><CODE>dstOffset</CODE> - the offset.<DD><CODE>s</CODE> - the sequence to be inserted
729<DT><B>Returns:</B><DD>a reference to the new Rope.
730<DT><B>Throws:</B>
731<DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if the offset is invalid.</DL>
732</DD>
733</DL>
734<HR>
735
736<A NAME="iterator(int)"><!-- --></A><H3>
737iterator</H3>
738<PRE>
739java.util.Iterator&lt;java.lang.Character&gt; <B>iterator</B>(int&nbsp;start)</PRE>
740<DL>
741<DD>Returns an iterator positioned to start at the specified index.
742<P>
743<DD><DL>
744</DL>
745</DD>
746<DD><DL>
747<DT><B>Parameters:</B><DD><CODE>start</CODE> - the start position.
748<DT><B>Returns:</B><DD>an iterator positioned to start at the specified index.</DL>
749</DD>
750</DL>
751<HR>
752
753<A NAME="trimStart()"><!-- --></A><H3>
754trimStart</H3>
755<PRE>
756<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>trimStart</B>()</PRE>
757<DL>
758<DD>Trims all whitespace as well as characters less than 0x20 from
759 the beginning of this string.
760<P>
761<DD><DL>
762</DL>
763</DD>
764<DD><DL>
765
766<DT><B>Returns:</B><DD>a rope with all leading whitespace trimmed.</DL>
767</DD>
768</DL>
769<HR>
770
771<A NAME="matcher(java.util.regex.Pattern)"><!-- --></A><H3>
772matcher</H3>
773<PRE>
774java.util.regex.Matcher <B>matcher</B>(java.util.regex.Pattern&nbsp;pattern)</PRE>
775<DL>
776<DD>Creates a matcher that will match this rope against the
777 specified pattern. This method produces a higher performance
778 matcher than:
779 <pre>
780 Matcher m = pattern.matcher(this);
781 </pre>
782 The difference may be asymptotically better in some cases.
783<P>
784<DD><DL>
785</DL>
786</DD>
787<DD><DL>
788<DT><B>Parameters:</B><DD><CODE>pattern</CODE> - the pattern to match this rope against.
789<DT><B>Returns:</B><DD>a matcher.</DL>
790</DD>
791</DL>
792<HR>
793
794<A NAME="matches(java.util.regex.Pattern)"><!-- --></A><H3>
795matches</H3>
796<PRE>
797boolean <B>matches</B>(java.util.regex.Pattern&nbsp;regex)</PRE>
798<DL>
799<DD>Returns <code>true</code> if this rope matches the specified
800 <code>Pattern</code>, or <code>false</code> otherwise.
801<P>
802<DD><DL>
803</DL>
804</DD>
805<DD><DL>
806<DT><B>Parameters:</B><DD><CODE>regex</CODE> - the specified regular expression.
807<DT><B>Returns:</B><DD><code>true</code> if this rope matches the specified
808 <code>Pattern</code>, or <code>false</code> otherwise.<DT><B>See Also:</B><DD><CODE>Pattern</CODE></DL>
809</DD>
810</DL>
811<HR>
812
813<A NAME="matches(java.lang.String)"><!-- --></A><H3>
814matches</H3>
815<PRE>
816boolean <B>matches</B>(java.lang.String&nbsp;regex)</PRE>
817<DL>
818<DD>Returns <code>true</code> if this rope matches the specified
819 regular expression, or <code>false</code> otherwise.
820<P>
821<DD><DL>
822</DL>
823</DD>
824<DD><DL>
825<DT><B>Parameters:</B><DD><CODE>regex</CODE> - the specified regular expression.
826<DT><B>Returns:</B><DD><code>true</code> if this rope matches the specified
827 regular expression, or <code>false</code> otherwise.<DT><B>See Also:</B><DD><CODE>Pattern</CODE></DL>
828</DD>
829</DL>
830<HR>
831
832<A NAME="rebalance()"><!-- --></A><H3>
833rebalance</H3>
834<PRE>
835<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>rebalance</B>()</PRE>
836<DL>
837<DD>Rebalances the current rope, returning the rebalanced rope. In general,
838 rope rebalancing is handled automatically, but this method is provided
839 to give users more control.
840<P>
841<DD><DL>
842</DL>
843</DD>
844<DD><DL>
845
846<DT><B>Returns:</B><DD>a rebalanced rope.</DL>
847</DD>
848</DL>
849<HR>
850
851<A NAME="reverse()"><!-- --></A><H3>
852reverse</H3>
853<PRE>
854<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>reverse</B>()</PRE>
855<DL>
856<DD>Reverses this rope.
857<P>
858<DD><DL>
859</DL>
860</DD>
861<DD><DL>
862
863<DT><B>Returns:</B><DD>a reversed copy of this rope.</DL>
864</DD>
865</DL>
866<HR>
867
868<A NAME="reverseIterator()"><!-- --></A><H3>
869reverseIterator</H3>
870<PRE>
871java.util.Iterator&lt;java.lang.Character&gt; <B>reverseIterator</B>()</PRE>
872<DL>
873<DD>Returns a reverse iterator positioned to start at the end of this
874 rope. A reverse iterator moves backwards instead of forwards through
875 a rope.
876<P>
877<DD><DL>
878</DL>
879</DD>
880<DD><DL>
881
882<DT><B>Returns:</B><DD>A reverse iterator positioned at the end of this rope.<DT><B>See Also:</B><DD><A HREF="/org/ahmadsoft/ropes/Rope.html#reverseIterator(int)"><CODE>reverseIterator(int)</CODE></A></DL>
883</DD>
884</DL>
885<HR>
886
887<A NAME="reverseIterator(int)"><!-- --></A><H3>
888reverseIterator</H3>
889<PRE>
890java.util.Iterator&lt;java.lang.Character&gt; <B>reverseIterator</B>(int&nbsp;start)</PRE>
891<DL>
892<DD>Returns a reverse iterator positioned to start at the specified index.
893 A reverse iterator moves backwards instead of forwards through a rope.
894<P>
895<DD><DL>
896</DL>
897</DD>
898<DD><DL>
899<DT><B>Parameters:</B><DD><CODE>start</CODE> - the start position.
900<DT><B>Returns:</B><DD>a reverse iterator positioned to start at the specified index from
901 the end of the rope. For example, a value of 1 indicates the iterator 
902 should start 1 character before the end of the rope.<DT><B>See Also:</B><DD><A HREF="/org/ahmadsoft/ropes/Rope.html#reverseIterator()"><CODE>reverseIterator()</CODE></A></DL>
903</DD>
904</DL>
905<HR>
906
907<A NAME="trimEnd()"><!-- --></A><H3>
908trimEnd</H3>
909<PRE>
910<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>trimEnd</B>()</PRE>
911<DL>
912<DD>Trims all whitespace as well as characters less than <code>0x20</code> from
913 the end of this rope.
914<P>
915<DD><DL>
916</DL>
917</DD>
918<DD><DL>
919
920<DT><B>Returns:</B><DD>a rope with all trailing whitespace trimmed.</DL>
921</DD>
922</DL>
923<HR>
924
925<A NAME="subSequence(int, int)"><!-- --></A><H3>
926subSequence</H3>
927<PRE>
928<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>subSequence</B>(int&nbsp;start,
929                 int&nbsp;end)</PRE>
930<DL>
931<DD><DL>
932<DT><B>Specified by:</B><DD><CODE>subSequence</CODE> in interface <CODE>java.lang.CharSequence</CODE></DL>
933</DD>
934<DD><DL>
935</DL>
936</DD>
937</DL>
938<HR>
939
940<A NAME="trim()"><!-- --></A><H3>
941trim</H3>
942<PRE>
943<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>trim</B>()</PRE>
944<DL>
945<DD>Trims all whitespace as well as characters less than <code>0x20</code> from
946 the beginning and end of this string.
947<P>
948<DD><DL>
949</DL>
950</DD>
951<DD><DL>
952
953<DT><B>Returns:</B><DD>a rope with all leading and trailing whitespace trimmed.</DL>
954</DD>
955</DL>
956<HR>
957
958<A NAME="write(java.io.Writer)"><!-- --></A><H3>
959write</H3>
960<PRE>
961void <B>write</B>(java.io.Writer&nbsp;out)
962           throws java.io.IOException</PRE>
963<DL>
964<DD>Write this rope to a <code>Writer</code>.
965<P>
966<DD><DL>
967</DL>
968</DD>
969<DD><DL>
970<DT><B>Parameters:</B><DD><CODE>out</CODE> - the writer object.
971<DT><B>Throws:</B>
972<DD><CODE>java.io.IOException</CODE></DL>
973</DD>
974</DL>
975<HR>
976
977<A NAME="write(java.io.Writer, int, int)"><!-- --></A><H3>
978write</H3>
979<PRE>
980void <B>write</B>(java.io.Writer&nbsp;out,
981           int&nbsp;offset,
982           int&nbsp;length)
983           throws java.io.IOException</PRE>
984<DL>
985<DD>Write a range of this rope to a <code>Writer</code>.
986<P>
987<DD><DL>
988</DL>
989</DD>
990<DD><DL>
991<DT><B>Parameters:</B><DD><CODE>out</CODE> - the writer object.<DD><CODE>offset</CODE> - the range offset.<DD><CODE>length</CODE> - the range length.
992<DT><B>Throws:</B>
993<DD><CODE>java.io.IOException</CODE></DL>
994</DD>
995</DL>
996<HR>
997
998<A NAME="padStart(int)"><!-- --></A><H3>
999padStart</H3>
1000<PRE>
1001<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>padStart</B>(int&nbsp;toLength)</PRE>
1002<DL>
1003<DD>Increase the length of this rope to the specified length by prepending 
1004 spaces to this rope. If the specified length is less than or equal to 
1005 the current length of the rope, the rope is returned unmodified.
1006<P>
1007<DD><DL>
1008</DL>
1009</DD>
1010<DD><DL>
1011<DT><B>Parameters:</B><DD><CODE>toLength</CODE> - the desired length.
1012<DT><B>Returns:</B><DD>the padded rope.<DT><B>See Also:</B><DD><A HREF="/org/ahmadsoft/ropes/Rope.html#padStart(int, char)"><CODE>padStart(int, char)</CODE></A></DL>
1013</DD>
1014</DL>
1015<HR>
1016
1017<A NAME="padStart(int, char)"><!-- --></A><H3>
1018padStart</H3>
1019<PRE>
1020<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>padStart</B>(int&nbsp;toLength,
1021              char&nbsp;padChar)</PRE>
1022<DL>
1023<DD>Increase the length of this rope to the specified length by repeatedly 
1024 prepending the specified character to this rope. If the specified length 
1025 is less than or equal to the current length of the rope, the rope is 
1026 returned unmodified.
1027<P>
1028<DD><DL>
1029</DL>
1030</DD>
1031<DD><DL>
1032<DT><B>Parameters:</B><DD><CODE>toLength</CODE> - the desired length.<DD><CODE>padChar</CODE> - the character to use for padding.
1033<DT><B>Returns:</B><DD>the padded rope.<DT><B>See Also:</B><DD><A HREF="/org/ahmadsoft/ropes/Rope.html#padStart(int, char)"><CODE>padStart(int, char)</CODE></A></DL>
1034</DD>
1035</DL>
1036<HR>
1037
1038<A NAME="padEnd(int)"><!-- --></A><H3>
1039padEnd</H3>
1040<PRE>
1041<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>padEnd</B>(int&nbsp;toLength)</PRE>
1042<DL>
1043<DD>Increase the length of this rope to the specified length by appending
1044 spaces to this rope. If the specified length is less than or equal to 
1045 the current length of the rope, the rope is returned unmodified.
1046<P>
1047<DD><DL>
1048</DL>
1049</DD>
1050<DD><DL>
1051<DT><B>Parameters:</B><DD><CODE>toLength</CODE> - the desired length.
1052<DT><B>Returns:</B><DD>the padded rope.<DT><B>See Also:</B><DD><A HREF="/org/ahmadsoft/ropes/Rope.html#padStart(int, char)"><CODE>padStart(int, char)</CODE></A></DL>
1053</DD>
1054</DL>
1055<HR>
1056
1057<A NAME="padEnd(int, char)"><!-- --></A><H3>
1058padEnd</H3>
1059<PRE>
1060<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> <B>padEnd</B>(int&nbsp;toLength,
1061            char&nbsp;padChar)</PRE>
1062<DL>
1063<DD>Increase the length of this rope to the specified length by repeatedly 
1064 appending the specified character to this rope. If the specified length 
1065 is less than or equal to the current length of the rope, the rope is 
1066 returned unmodified.
1067<P>
1068<DD><DL>
1069</DL>
1070</DD>
1071<DD><DL>
1072<DT><B>Parameters:</B><DD><CODE>toLength</CODE> - the desired length.<DD><CODE>padChar</CODE> - the character to use for padding.
1073<DT><B>Returns:</B><DD>the padded rope.<DT><B>See Also:</B><DD><A HREF="/org/ahmadsoft/ropes/Rope.html#padStart(int, char)"><CODE>padStart(int, char)</CODE></A></DL>
1074</DD>
1075</DL>
1076<HR>
1077
1078<A NAME="isEmpty()"><!-- --></A><H3>
1079isEmpty</H3>
1080<PRE>
1081boolean <B>isEmpty</B>()</PRE>
1082<DL>
1083<DD>Returns true if and only if the length of this rope is zero.
1084<P>
1085<DD><DL>
1086</DL>
1087</DD>
1088<DD><DL>
1089
1090<DT><B>Returns:</B><DD><code>true</code> if and only if the length of this
1091 rope is zero, and <code>false</code> otherwise.</DL>
1092</DD>
1093</DL>
1094<HR>
1095
1096<A NAME="startsWith(java.lang.CharSequence)"><!-- --></A><H3>
1097startsWith</H3>
1098<PRE>
1099boolean <B>startsWith</B>(java.lang.CharSequence&nbsp;prefix)</PRE>
1100<DL>
1101<DD>Returns <code>true</code> if this rope starts with the specified 
1102 prefix.
1103<P>
1104<DD><DL>
1105</DL>
1106</DD>
1107<DD><DL>
1108<DT><B>Parameters:</B><DD><CODE>prefix</CODE> - the prefix to test.
1109<DT><B>Returns:</B><DD><code>true</code> if this rope starts with the 
1110 specified prefix and <code>false</code> otherwise.<DT><B>See Also:</B><DD><A HREF="/org/ahmadsoft/ropes/Rope.html#startsWith(java.lang.CharSequence, int)"><CODE>startsWith(CharSequence, int)</CODE></A></DL>
1111</DD>
1112</DL>
1113<HR>
1114
1115<A NAME="startsWith(java.lang.CharSequence, int)"><!-- --></A><H3>
1116startsWith</H3>
1117<PRE>
1118boolean <B>startsWith</B>(java.lang.CharSequence&nbsp;prefix,
1119                   int&nbsp;offset)</PRE>
1120<DL>
1121<DD>Returns <code>true</code> if this rope, beginning from a specified
1122 offset, starts with the specified prefix.
1123<P>
1124<DD><DL>
1125</DL>
1126</DD>
1127<DD><DL>
1128<DT><B>Parameters:</B><DD><CODE>prefix</CODE> - the prefix to test.<DD><CODE>offset</CODE> - the start offset.
1129<DT><B>Returns:</B><DD><code>true</code> if this rope starts with the 
1130 specified prefix and <code>false</code> otherwise.</DL>
1131</DD>
1132</DL>
1133<HR>
1134
1135<A NAME="endsWith(java.lang.CharSequence)"><!-- --></A><H3>
1136endsWith</H3>
1137<PRE>
1138boolean <B>endsWith</B>(java.lang.CharSequence&nbsp;suffix)</PRE>
1139<DL>
1140<DD>Returns <code>true</code> if this rope ends with the specified 
1141 suffix.
1142<P>
1143<DD><DL>
1144</DL>
1145</DD>
1146<DD><DL>
1147<DT><B>Parameters:</B><DD><CODE>suffix</CODE> - the suffix to test.
1148<DT><B>Returns:</B><DD><code>true</code> if this rope starts with the 
1149 specified suffix and <code>false</code> otherwise.<DT><B>See Also:</B><DD><A HREF="/org/ahmadsoft/ropes/Rope.html#endsWith(java.lang.CharSequence, int)"><CODE>endsWith(CharSequence, int)</CODE></A></DL>
1150</DD>
1151</DL>
1152<HR>
1153
1154<A NAME="endsWith(java.lang.CharSequence, int)"><!-- --></A><H3>
1155endsWith</H3>
1156<PRE>
1157boolean <B>endsWith</B>(java.lang.CharSequence&nbsp;suffix,
1158                 int&nbsp;offset)</PRE>
1159<DL>
1160<DD>Returns <code>true</code> if this rope, terminated at a specified
1161 offset, ends with the specified suffix.
1162<P>
1163<DD><DL>
1164</DL>
1165</DD>
1166<DD><DL>
1167<DT><B>Parameters:</B><DD><CODE>suffix</CODE> - the suffix to test.<DD><CODE>offset</CODE> - the termination offset, counted from the end of the 
1168 rope.
1169<DT><B>Returns:</B><DD><code>true</code> if this rope starts with the 
1170 specified prefix and <code>false</code> otherwise.</DL>
1171</DD>
1172</DL>
1173<!-- ========= END OF CLASS DATA ========= -->
1174<HR>
1175
1176
1177<!-- ======= START OF BOTTOM NAVBAR ====== -->
1178<A NAME="navbar_bottom"><!-- --></A>
1179<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
1180<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
1181<TR>
1182<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
1183<A NAME="navbar_bottom_firstrow"><!-- --></A>
1184<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
1185  <TR ALIGN="center" VALIGN="top">
1186  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
1187  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
1188  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
1189  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
1190  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
1191  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
1192  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
1193  </TR>
1194</TABLE>
1195</TD>
1196<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
1197</EM>
1198</TD>
1199</TR>
1200
1201<TR>
1202<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1203&nbsp;PREV CLASS&nbsp;
1204&nbsp;<A HREF="/org/ahmadsoft/ropes/RopeBuilder.html" title="class in org.ahmadsoft.ropes"><B>NEXT CLASS</B></A></FONT></TD>
1205<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1206  <A HREF="/index.html?org/ahmadsoft/ropes/Rope.html" target="_top"><B>FRAMES</B></A>  &nbsp;
1207&nbsp;<A HREF="Rope.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
1208&nbsp;<SCRIPT type="text/javascript">
1209  <!--
1210  if(window==top) {
1211    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
1212  }
1213  //-->
1214</SCRIPT>
1215<NOSCRIPT>
1216  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
1217</NOSCRIPT>
1218
1219
1220</FONT></TD>
1221</TR>
1222<TR>
1223<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1224  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
1225<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1226DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
1227</TR>
1228</TABLE>
1229<A NAME="skip-navbar_bottom"></A>
1230<!-- ======== END OF BOTTOM NAVBAR ======= -->
1231
1232<HR>
1233<i>Copyright &#169; 2008, 2009 Amin Ahmad. All Rights Reserved.</i>
1234</BODY>
1235</HTML>
1236