org.ahmadsoft.ropes.impl
Class ConcatenationRopeReverseIteratorImpl
java.lang.Object
org.ahmadsoft.ropes.impl.ConcatenationRopeReverseIteratorImpl
- All Implemented Interfaces:
- java.util.Iterator<java.lang.Character>
public class ConcatenationRopeReverseIteratorImpl
- extends java.lang.Object
- implements java.util.Iterator<java.lang.Character>
A fast reverse iterator for concatenated ropes. Iterating over
a complex rope structure is guaranteed to be O(n) so long as it
is reasonably well-balanced. Compare this to O(n log n) for
iteration using charAt
.
- Author:
- aahmad
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConcatenationRopeReverseIteratorImpl
public ConcatenationRopeReverseIteratorImpl(Rope rope)
ConcatenationRopeReverseIteratorImpl
public ConcatenationRopeReverseIteratorImpl(Rope rope,
int start)
canMoveBackwards
public boolean canMoveBackwards(int amount)
getPos
public int getPos()
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator<java.lang.Character>
moveBackwards
public void moveBackwards(int amount)
moveForward
public void moveForward(int amount)
next
public java.lang.Character next()
- Specified by:
next
in interface java.util.Iterator<java.lang.Character>
remove
public void remove()
- Specified by:
remove
in interface java.util.Iterator<java.lang.Character>
skip
public void skip(int skip)
Copyright © 2007 Amin Ahmad. All Rights Reserved.