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) on Sat Dec 29 16:44:59 EST 2007 --> 6<TITLE> 7ConcatenationRopeReverseIteratorImpl 8</TITLE> 9 10<META NAME="date" CONTENT="2007-12-29"> 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="ConcatenationRopeReverseIteratorImpl"; 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> </TD> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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 <A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeIteratorImpl.html" title="class in org.ahmadsoft.ropes.impl"><B>PREV CLASS</B></A> 58 <A HREF="/org/ahmadsoft/ropes/impl/FlatCharArrayRope.html" title="class in org.ahmadsoft.ropes.impl"><B>NEXT CLASS</B></A></FONT></TD> 59<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 60 <A HREF="/index.html?org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html" target="_top"><B>FRAMES</B></A> 61 <A HREF="ConcatenationRopeReverseIteratorImpl.html" target="_top"><B>NO FRAMES</B></A> 62 <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 79<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 80DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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.impl</FONT> 91<BR> 92Class ConcatenationRopeReverseIteratorImpl</H2> 93<PRE> 94java.lang.Object 95 <IMG SRC="/resources/inherit.gif" ALT="extended by "><B>org.ahmadsoft.ropes.impl.ConcatenationRopeReverseIteratorImpl</B> 96</PRE> 97<DL> 98<DT><B>All Implemented Interfaces:</B> <DD>java.util.Iterator<java.lang.Character></DD> 99</DL> 100<HR> 101<DL> 102<DT><PRE>public class <B>ConcatenationRopeReverseIteratorImpl</B><DT>extends java.lang.Object<DT>implements java.util.Iterator<java.lang.Character></DL> 103</PRE> 104 105<P> 106A fast reverse iterator for concatenated ropes. Iterating over 107 a complex rope structure is guaranteed to be O(n) so long as it 108 is reasonably well-balanced. Compare this to O(n log n) for 109 iteration using <code>charAt</code>. 110<P> 111 112<P> 113<DL> 114<DT><B>Author:</B></DT> 115 <DD>aahmad</DD> 116</DL> 117<HR> 118 119<P> 120 121<!-- ======== CONSTRUCTOR SUMMARY ======== --> 122 123<A NAME="constructor_summary"><!-- --></A> 124<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 125<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 126<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 127<B>Constructor Summary</B></FONT></TH> 128</TR> 129<TR BGCOLOR="white" CLASS="TableRowColor"> 130<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#ConcatenationRopeReverseIteratorImpl(org.ahmadsoft.ropes.Rope)">ConcatenationRopeReverseIteratorImpl</A></B>(<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> rope)</CODE> 131 132<BR> 133 </TD> 134</TR> 135<TR BGCOLOR="white" CLASS="TableRowColor"> 136<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#ConcatenationRopeReverseIteratorImpl(org.ahmadsoft.ropes.Rope, int)">ConcatenationRopeReverseIteratorImpl</A></B>(<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> rope, 137 int start)</CODE> 138 139<BR> 140 </TD> 141</TR> 142</TABLE> 143 144<!-- ========== METHOD SUMMARY =========== --> 145 146<A NAME="method_summary"><!-- --></A> 147<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 148<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 149<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 150<B>Method Summary</B></FONT></TH> 151</TR> 152<TR BGCOLOR="white" CLASS="TableRowColor"> 153<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 154<CODE> boolean</CODE></FONT></TD> 155<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#canMoveBackwards(int)">canMoveBackwards</A></B>(int amount)</CODE> 156 157<BR> 158 </TD> 159</TR> 160<TR BGCOLOR="white" CLASS="TableRowColor"> 161<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 162<CODE> int</CODE></FONT></TD> 163<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#getPos()">getPos</A></B>()</CODE> 164 165<BR> 166 </TD> 167</TR> 168<TR BGCOLOR="white" CLASS="TableRowColor"> 169<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 170<CODE> boolean</CODE></FONT></TD> 171<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#hasNext()">hasNext</A></B>()</CODE> 172 173<BR> 174 </TD> 175</TR> 176<TR BGCOLOR="white" CLASS="TableRowColor"> 177<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 178<CODE> void</CODE></FONT></TD> 179<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#moveBackwards(int)">moveBackwards</A></B>(int amount)</CODE> 180 181<BR> 182 </TD> 183</TR> 184<TR BGCOLOR="white" CLASS="TableRowColor"> 185<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 186<CODE> void</CODE></FONT></TD> 187<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#moveForward(int)">moveForward</A></B>(int amount)</CODE> 188 189<BR> 190 </TD> 191</TR> 192<TR BGCOLOR="white" CLASS="TableRowColor"> 193<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 194<CODE> java.lang.Character</CODE></FONT></TD> 195<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#next()">next</A></B>()</CODE> 196 197<BR> 198 </TD> 199</TR> 200<TR BGCOLOR="white" CLASS="TableRowColor"> 201<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 202<CODE> void</CODE></FONT></TD> 203<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#remove()">remove</A></B>()</CODE> 204 205<BR> 206 </TD> 207</TR> 208<TR BGCOLOR="white" CLASS="TableRowColor"> 209<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 210<CODE> void</CODE></FONT></TD> 211<TD><CODE><B><A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html#skip(int)">skip</A></B>(int skip)</CODE> 212 213<BR> 214 </TD> 215</TR> 216</TABLE> 217 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 218<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 219<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 220<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> 221</TR> 222<TR BGCOLOR="white" CLASS="TableRowColor"> 223<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> 224</TR> 225</TABLE> 226 227<P> 228 229<!-- ========= CONSTRUCTOR DETAIL ======== --> 230 231<A NAME="constructor_detail"><!-- --></A> 232<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 233<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 234<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 235<B>Constructor Detail</B></FONT></TH> 236</TR> 237</TABLE> 238 239<A NAME="ConcatenationRopeReverseIteratorImpl(org.ahmadsoft.ropes.Rope)"><!-- --></A><H3> 240ConcatenationRopeReverseIteratorImpl</H3> 241<PRE> 242public <B>ConcatenationRopeReverseIteratorImpl</B>(<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> rope)</PRE> 243<DL> 244</DL> 245<HR> 246 247<A NAME="ConcatenationRopeReverseIteratorImpl(org.ahmadsoft.ropes.Rope, int)"><!-- --></A><H3> 248ConcatenationRopeReverseIteratorImpl</H3> 249<PRE> 250public <B>ConcatenationRopeReverseIteratorImpl</B>(<A HREF="/org/ahmadsoft/ropes/Rope.html" title="interface in org.ahmadsoft.ropes">Rope</A> rope, 251 int start)</PRE> 252<DL> 253</DL> 254 255<!-- ============ METHOD DETAIL ========== --> 256 257<A NAME="method_detail"><!-- --></A> 258<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 259<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 260<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 261<B>Method Detail</B></FONT></TH> 262</TR> 263</TABLE> 264 265<A NAME="canMoveBackwards(int)"><!-- --></A><H3> 266canMoveBackwards</H3> 267<PRE> 268public boolean <B>canMoveBackwards</B>(int amount)</PRE> 269<DL> 270<DD><DL> 271</DL> 272</DD> 273<DD><DL> 274</DL> 275</DD> 276</DL> 277<HR> 278 279<A NAME="getPos()"><!-- --></A><H3> 280getPos</H3> 281<PRE> 282public int <B>getPos</B>()</PRE> 283<DL> 284<DD><DL> 285</DL> 286</DD> 287<DD><DL> 288</DL> 289</DD> 290</DL> 291<HR> 292 293<A NAME="hasNext()"><!-- --></A><H3> 294hasNext</H3> 295<PRE> 296public boolean <B>hasNext</B>()</PRE> 297<DL> 298<DD><DL> 299<DT><B>Specified by:</B><DD><CODE>hasNext</CODE> in interface <CODE>java.util.Iterator<java.lang.Character></CODE></DL> 300</DD> 301<DD><DL> 302</DL> 303</DD> 304</DL> 305<HR> 306 307<A NAME="moveBackwards(int)"><!-- --></A><H3> 308moveBackwards</H3> 309<PRE> 310public void <B>moveBackwards</B>(int amount)</PRE> 311<DL> 312<DD><DL> 313</DL> 314</DD> 315<DD><DL> 316</DL> 317</DD> 318</DL> 319<HR> 320 321<A NAME="moveForward(int)"><!-- --></A><H3> 322moveForward</H3> 323<PRE> 324public void <B>moveForward</B>(int amount)</PRE> 325<DL> 326<DD><DL> 327</DL> 328</DD> 329<DD><DL> 330</DL> 331</DD> 332</DL> 333<HR> 334 335<A NAME="next()"><!-- --></A><H3> 336next</H3> 337<PRE> 338public java.lang.Character <B>next</B>()</PRE> 339<DL> 340<DD><DL> 341<DT><B>Specified by:</B><DD><CODE>next</CODE> in interface <CODE>java.util.Iterator<java.lang.Character></CODE></DL> 342</DD> 343<DD><DL> 344</DL> 345</DD> 346</DL> 347<HR> 348 349<A NAME="remove()"><!-- --></A><H3> 350remove</H3> 351<PRE> 352public void <B>remove</B>()</PRE> 353<DL> 354<DD><DL> 355<DT><B>Specified by:</B><DD><CODE>remove</CODE> in interface <CODE>java.util.Iterator<java.lang.Character></CODE></DL> 356</DD> 357<DD><DL> 358</DL> 359</DD> 360</DL> 361<HR> 362 363<A NAME="skip(int)"><!-- --></A><H3> 364skip</H3> 365<PRE> 366public void <B>skip</B>(int skip)</PRE> 367<DL> 368<DD><DL> 369</DL> 370</DD> 371<DD><DL> 372</DL> 373</DD> 374</DL> 375<!-- ========= END OF CLASS DATA ========= --> 376<HR> 377 378 379<!-- ======= START OF BOTTOM NAVBAR ====== --> 380<A NAME="navbar_bottom"><!-- --></A> 381<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 382<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 383<TR> 384<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 385<A NAME="navbar_bottom_firstrow"><!-- --></A> 386<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 387 <TR ALIGN="center" VALIGN="top"> 388 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 389 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 390 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 391 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 392 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 393 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 394 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 395 </TR> 396</TABLE> 397</TD> 398<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 399</EM> 400</TD> 401</TR> 402 403<TR> 404<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 405 <A HREF="/org/ahmadsoft/ropes/impl/ConcatenationRopeIteratorImpl.html" title="class in org.ahmadsoft.ropes.impl"><B>PREV CLASS</B></A> 406 <A HREF="/org/ahmadsoft/ropes/impl/FlatCharArrayRope.html" title="class in org.ahmadsoft.ropes.impl"><B>NEXT CLASS</B></A></FONT></TD> 407<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 408 <A HREF="/index.html?org/ahmadsoft/ropes/impl/ConcatenationRopeReverseIteratorImpl.html" target="_top"><B>FRAMES</B></A> 409 <A HREF="ConcatenationRopeReverseIteratorImpl.html" target="_top"><B>NO FRAMES</B></A> 410 <SCRIPT type="text/javascript"> 411 <!-- 412 if(window==top) { 413 document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>'); 414 } 415 //--> 416</SCRIPT> 417<NOSCRIPT> 418 <A HREF="/allclasses-noframe.html"><B>All Classes</B></A> 419</NOSCRIPT> 420 421 422</FONT></TD> 423</TR> 424<TR> 425<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 426 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 427<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 428DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 429</TR> 430</TABLE> 431<A NAME="skip-navbar_bottom"></A> 432<!-- ======== END OF BOTTOM NAVBAR ======= --> 433 434<HR> 435<i>Copyright © 2007 Amin Ahmad. All Rights Reserved.</i> 436</BODY> 437</HTML> 438