|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ahmadsoft.ropes.impl.AbstractRope
org.ahmadsoft.ropes.impl.SubstringRope
public class SubstringRope
Represents a lazily-evaluated substring of another rope. For performance
reasons, the target rope must be a FlatRope
.
Field Summary |
---|
Fields inherited from interface org.ahmadsoft.ropes.Rope |
---|
BUILDER |
Constructor Summary | |
---|---|
SubstringRope(FlatRope rope,
int offset,
int length)
|
Method Summary | |
---|---|
char |
charAt(int index)
|
byte |
depth()
|
Rope |
getRope()
Returns the rope underlying this one. |
java.util.Iterator<java.lang.Character> |
iterator(int start)
Returns an iterator positioned to start at the specified index. |
int |
length()
|
java.util.regex.Matcher |
matcher(java.util.regex.Pattern pattern)
Creates a matcher that will match this rope against the specified pattern. |
Rope |
rebalance()
Rebalances the current rope, returning the rebalanced rope. |
Rope |
subSequence(int start,
int end)
|
java.lang.String |
toString()
|
void |
write(java.io.Writer out)
Write this rope. |
void |
write(java.io.Writer out,
int offset,
int length)
Write this rope. |
Methods inherited from class org.ahmadsoft.ropes.impl.AbstractRope |
---|
append, append, append, compareTo, delete, equals, hashCode, indexOf, insert, iterator |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SubstringRope(FlatRope rope, int offset, int length)
Method Detail |
---|
public char charAt(int index)
public byte depth()
depth
in class AbstractRope
public Rope getRope()
public java.util.Iterator<java.lang.Character> iterator(int start)
Rope
start
- the start position.
public int length()
public Rope subSequence(int start, int end)
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class AbstractRope
public Rope rebalance()
Rope
public void write(java.io.Writer out) throws java.io.IOException
Rope
java.io.IOException
public void write(java.io.Writer out, int offset, int length) throws java.io.IOException
Rope
java.io.IOException
public java.util.regex.Matcher matcher(java.util.regex.Pattern pattern)
Rope
Matcher m = pattern.matcher(this);The difference may be asymptotically better in many cases.
pattern
- the pattern to match this rope against.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |