public static class RrbTree.ImRrbt<E> extends RrbTree<E> implements ImList<E>
RrbTree
RrbTree.ImRrbt<E>, RrbTree.MutableRrbt<E>
UnmodList.AbstractUnmodList<E>
UnmodIterable.AbstractUnmodIterable<T>
SPACES, SPACES_LENGTH_MINUS_ONE
Modifier and Type | Method and Description |
---|---|
RrbTree.ImRrbt<E> |
append(E val)
Adds one item to the end of the ImList.
|
RrbTree.ImRrbt<E> |
concat(Iterable<? extends E> es)
Efficiently adds items to the end of this ImList.
|
E |
get(int i) |
String |
indentedStr(int indent)
Returns a string where line breaks extend the given amount of indentation.
|
RrbTree.ImRrbt<E> |
insert(int idx,
E element)
Inserts an item in the RRB tree pushing the current element at that index and all subsequent
elements to the right.
|
UnmodSortedIterator<E> |
iterator()
A convenience method to get a listIterator.
|
RrbTree<E> |
join(RrbTree<E> that)
Joins the given tree to the right side of this tree (or this to the left side of that one)
in something like O(log n) time.
|
RrbTree.MutableRrbt<E> |
mutable()
Returns a mutable list (builder)
|
RrbTree.ImRrbt<E> |
replace(int index,
E item)
Replace the item at the given index.
|
int |
size()
Returns the number of items in this collection or iterable.
|
Tuple2<RrbTree<E>,RrbTree<E>> |
split(int splitIndex)
Divides this RRB-Tree such that every index less-than the given index ends up in the left-hand
tree and the indexed item and all subsequent ones end up in the right-hand tree.
|
String |
toString() |
RrbTree.ImRrbt<E> |
without(int index)
Returns a new RrbTree minus the given item (all items to the right are shifted left one)
This is O(log n).
|
empty, emptyMutable, equals, hashCode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, addAll, addAll, clear, contains, containsAll, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, permutations, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, subList, toArray, toArray
equals, hashCode, spliterator
parallelStream, stream
castFromList, castFromSortedMap, castFromSortedSet, equal
drop, filter, flatMap, fold, foldUntil, hash, head, map, precat, take, takeWhile, toString
toImList, toImMap, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableSet, toMutableSortedMap, toMutableSortedSet
arrayString, arrayString, indentSpace
public RrbTree.ImRrbt<E> append(E val)
public RrbTree.ImRrbt<E> concat(Iterable<? extends E> es)
public E get(int i)
public RrbTree.ImRrbt<E> insert(int idx, E element)
public RrbTree.MutableRrbt<E> mutable()
public UnmodSortedIterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in interface List<E>
iterator
in interface UnmodCollection<E>
iterator
in interface UnmodIterable<E>
iterator
in interface UnmodList<E>
iterator
in interface UnmodSortedCollection<E>
iterator
in interface UnmodSortedIterable<E>
iterator
in class RrbTree<E>
public RrbTree<E> join(RrbTree<E> that)
public RrbTree.ImRrbt<E> replace(int index, E item)
public RrbTree.ImRrbt<E> without(int index)
public int size()
RrbTree
public Tuple2<RrbTree<E>,RrbTree<E>> split(int splitIndex)
public String indentedStr(int indent)
indentedStr
in interface Indented
indentedStr
in class RrbTree<E>
indent
- the amount of indent to start at. Pretty-printed subsequent lines may have
additional indent.Copyright © 2017. All rights reserved.