public class Rope extends Object implements Comparable<Rope>
insert, remove,
slice, and concat calls, and can be converted in constant time to a Java CharSequence
via toCharSequence().| Modifier and Type | Method and Description |
|---|---|
Iterator<ByteBuffer> |
bytes() |
PrimitiveIterator.OfInt |
chars() |
PrimitiveIterator.OfInt |
codePoints() |
int |
compareTo(Rope o) |
Rope |
concat(Rope rope) |
boolean |
equals(Object obj) |
Rope |
forked() |
static Rope |
from(CharSequence cs) |
int |
hashCode() |
Rope |
insert(int index,
CharSequence cs) |
Rope |
insert(int idx,
Rope rope) |
boolean |
isLinear() |
Rope |
linear() |
int |
nth(int idx) |
Rope |
remove(int start,
int end) |
PrimitiveIterator.OfInt |
reverseChars() |
PrimitiveIterator.OfInt |
reverseCodePoints() |
int |
size() |
Rope |
slice(int start,
int end) |
CharSequence |
toCharSequence() |
String |
toString() |
public static final Rope EMPTY
public static Rope from(CharSequence cs)
cspublic int nth(int idx)
IndexOutOfBoundsException - if idx is not within [0, size)public int size()
public Rope remove(int start, int end)
[start, end)IllegalArgumentException - if start or end are not within [0, size) public Rope insert(int idx, Rope rope)
rope inserted after the first idx code pointspublic Rope insert(int index, CharSequence cs)
cs inserted after the first index code pointspublic Rope slice(int start, int end)
[start, end)IllegalArgumentException - if end < start, or start and end are not within [0, size)public boolean isLinear()
public Rope forked()
public Rope linear()
public Iterator<ByteBuffer> bytes()
public PrimitiveIterator.OfInt reverseChars()
public PrimitiveIterator.OfInt chars()
public PrimitiveIterator.OfInt reverseCodePoints()
public PrimitiveIterator.OfInt codePoints()
public String toString()
public CharSequence toCharSequence()
CharSequence in O(1) timepublic int compareTo(Rope o)
compareTo in interface Comparable<Rope>