|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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, equals, hashCode, indexOf, insert, iterator, ltrim, matcher, matches, matches, rebalance, reverseIterator, rtrim, trim, 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, indexOf, insert, ltrim, matcher, matches, matches, rebalance, reverseIterator, rtrim, trim |
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.CharSequence
public byte depth()
depth
in class AbstractRope
public int indexOf(char ch)
Rope
ch
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 Rope
indexOf
in class AbstractRope
ch
- a character.
-1
if the character
does not occur.public int indexOf(char ch, int fromIndex)
Rope
ch
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 Rope
indexOf
in class AbstractRope
ch
- 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 Rope
indexOf
in class AbstractRope
sequence
- 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 Rope
start
- the start position.
public int length()
length
in interface java.lang.CharSequence
public Rope reverse()
Rope
reverse
in interface Rope
public java.util.Iterator<java.lang.Character> reverseIterator(int start)
Rope
reverseIterator
in interface Rope
start
- the start position.
Rope.reverseIterator()
public Rope subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
subSequence
in interface Rope
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
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
Rope
Writer
.
write
in interface Rope
out
- the writer object.
java.io.IOException
public void write(java.io.Writer out, int offset, int length) throws java.io.IOException
Rope
Writer
.
write
in interface Rope
out
- 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 |