|
|||||||||
| 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.FlatCharArrayRope
public final class FlatCharArrayRope
A rope constructed from a character array. This rope is even flatter than a regular flat rope.
| Field Summary |
|---|
| Fields inherited from interface org.ahmadsoft.ropes.Rope |
|---|
BUILDER |
| Constructor Summary | |
|---|---|
FlatCharArrayRope(char[] sequence)
Constructs a new rope from a character array. |
|
FlatCharArrayRope(char[] sequence,
int offset,
int length)
Constructs a new rope from a character array range. |
|
| Method Summary | |
|---|---|
char |
charAt(int index)
|
byte |
depth()
|
int |
indexOf(char ch)
Returns the index within this rope of the first occurrence of the specified character. |
int |
indexOf(char ch,
int fromIndex)
Returns the index within this rope of the first occurrence of the specified character, beginning at the specified index. |
int |
indexOf(java.lang.CharSequence sequence,
int fromIndex)
Returns the index within this rope of the first occurrence of the specified string, beginning at the specified index. |
java.util.Iterator<java.lang.Character> |
iterator(int start)
Returns an iterator positioned to start at the specified index. |
int |
length()
|
Rope |
reverse()
Reverses this rope. |
java.util.Iterator<java.lang.Character> |
reverseIterator(int start)
Returns a reverse iterator positioned to start at the specified index. |
Rope |
subSequence(int start,
int end)
|
java.lang.String |
toString()
|
java.lang.String |
toString(int offset,
int length)
Returns a String representation of a range
in this rope. |
void |
write(java.io.Writer out)
Write this rope to a Writer. |
void |
write(java.io.Writer out,
int offset,
int length)
Write a range of this rope to a Writer. |
| Methods inherited from class org.ahmadsoft.ropes.impl.AbstractRope |
|---|
append, append, append, compareTo, delete, endsWith, endsWith, equals, hashCode, indexOf, insert, isEmpty, iterator, matcher, matches, matches, padEnd, padEnd, padStart, padStart, rebalance, reverseIterator, startsWith, startsWith, trim, trimEnd, trimStart, writeReplace |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.ahmadsoft.ropes.Rope |
|---|
append, append, append, delete, endsWith, endsWith, indexOf, insert, isEmpty, matcher, matches, matches, padEnd, padEnd, padStart, padStart, rebalance, reverseIterator, startsWith, startsWith, trim, trimEnd, trimStart |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Constructor Detail |
|---|
public FlatCharArrayRope(char[] sequence)
sequence - the character array.
public FlatCharArrayRope(char[] sequence,
int offset,
int length)
sequence - the character array.offset - the offset in the array.length - the length of the array.| Method Detail |
|---|
public char charAt(int index)
charAt in interface java.lang.CharSequencepublic byte depth()
depth in class AbstractRopepublic int indexOf(char ch)
Ropech occurs
in the character sequence represented by this Rope
object, then the index of the first such occurrence is returned --
that is, the smallest value k such that:
this.charAt(k) == ch
is true. If no such character occurs in this string, then
-1 is returned.
indexOf in interface RopeindexOf in class AbstractRopech - a character.
-1 if the character
does not occur.
public int indexOf(char ch,
int fromIndex)
Ropech occurs in the character sequence
represented by this Rope object, then the index of the
first such occurrence is returned—that is, the smallest value k
such that:
this.charAt(k) == ch
is true. If no such character occurs in this string, then
-1 is returned.
indexOf in interface RopeindexOf in class AbstractRopech - a character.fromIndex - the index to start searching from.
public int indexOf(java.lang.CharSequence sequence,
int fromIndex)
Rope
k >= fromIndex && this.startsWith(str, k)
If no such k exists, then -1 is returned.
indexOf in interface RopeindexOf in class AbstractRopesequence - the string to find.fromIndex - the index to start searching from.
public java.util.Iterator<java.lang.Character> iterator(int start)
Rope
iterator in interface Ropestart - the start position.
public int length()
length in interface java.lang.CharSequencepublic Rope reverse()
Rope
reverse in interface Ropepublic java.util.Iterator<java.lang.Character> reverseIterator(int start)
Rope
reverseIterator in interface Ropestart - the start position.
Rope.reverseIterator()
public Rope subSequence(int start,
int end)
subSequence in interface java.lang.CharSequencesubSequence in interface Ropepublic java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class AbstractRope
public java.lang.String toString(int offset,
int length)
String representation of a range
in this rope.
offset - the offset.length - the length.
String representation of a range
in this rope.
public void write(java.io.Writer out)
throws java.io.IOException
RopeWriter.
write in interface Ropeout - the writer object.
java.io.IOException
public void write(java.io.Writer out,
int offset,
int length)
throws java.io.IOException
RopeWriter.
write in interface Ropeout - the writer object.offset - the range offset.length - the range length.
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||