Package org.pkl.core.util.paguro
Class RrbTree.MutRrbt<E>
java.lang.Object
org.pkl.core.util.paguro.RrbTree<E>
org.pkl.core.util.paguro.RrbTree.MutRrbt<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>,SequencedCollection<E>,org.organicdesign.fp.collections.BaseList<E>,org.organicdesign.fp.collections.MutList<E>,org.organicdesign.fp.collections.Sized,org.organicdesign.fp.collections.UnmodCollection<E>,org.organicdesign.fp.collections.UnmodIterable<E>,org.organicdesign.fp.collections.UnmodList<E>,org.organicdesign.fp.collections.UnmodSortedCollection<E>,org.organicdesign.fp.collections.UnmodSortedIterable<E>,org.organicdesign.fp.indent.Indented,org.organicdesign.fp.xform.Transformable<E>
public static class RrbTree.MutRrbt<E>
extends RrbTree<E>
implements org.organicdesign.fp.collections.MutList<E>
Mutable version of an
RrbTree. Timing information is available there.-
Nested Class Summary
Nested classes/interfaces inherited from class org.pkl.core.util.paguro.RrbTree
RrbTree.ImRrbt<E>, RrbTree.MutRrbt<E>, RrbTree.Node<T>, RrbTree.SplitNode<T>Nested classes/interfaces inherited from interface org.organicdesign.fp.collections.UnmodIterable
org.organicdesign.fp.collections.UnmodIterable.UnIterableNested classes/interfaces inherited from interface org.organicdesign.fp.collections.UnmodList
org.organicdesign.fp.collections.UnmodList.AbstractUnmodList<E> -
Method Summary
Modifier and TypeMethodDescriptionappendSome(org.organicdesign.fp.function.Fn0<? extends org.organicdesign.fp.oneOf.Option<E>> supplier) get(int i) indentedStr(int indent) Inserts an item in the RRB tree pushing the current element at that index and all subsequent elements to the right.org.organicdesign.fp.collections.UnmodSortedIterator<E> iterator()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.protected RrbTree.MutRrbt<E> makeNew(E[] f, int fi, int fl, RrbTree.Node<E> r, int s) Allows removing duplicated code by letting super-class produce new members of subclass types.protected RrbTree.MutRrbt<E> mt()Creates a new empty ("M-T") tree of the appropriate (mutable/immutable) type.Precat is implemented here because it is a very cheap operation on an RRB-Tree.intsize()org.organicdesign.fp.tuple.Tuple2<RrbTree.MutRrbt<E>, RrbTree.MutRrbt<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.toString()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).Methods inherited from class org.pkl.core.util.paguro.RrbTree
empty, emptyMutable, equals, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.organicdesign.fp.collections.BaseList
get, headMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, reversed, spliteratorMethods inherited from interface org.organicdesign.fp.collections.MutList
add, addAll, reverseMethods inherited from interface org.organicdesign.fp.xform.Transformable
any, toImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutList, toMutMap, toMutRrbt, toMutSet, toMutSortedMap, toMutSortedSetMethods inherited from interface org.organicdesign.fp.collections.UnmodIterable
drop, dropWhile, filter, flatMap, fold, foldUntil, map, take, takeWhile, whereNonNullMethods inherited from interface org.organicdesign.fp.collections.UnmodList
add, addAll, clear, contains, containsAll, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, subList, toArray, toArray
-
Method Details
-
makeNew
Description copied from class:RrbTreeAllows removing duplicated code by letting super-class produce new members of subclass types. -
append
-
appendSome
public RrbTree.MutRrbt<E> appendSome(org.organicdesign.fp.function.Fn0<? extends org.organicdesign.fp.oneOf.Option<E>> supplier) - Specified by:
appendSomein interfaceorg.organicdesign.fp.collections.BaseList<E>- Specified by:
appendSomein interfaceorg.organicdesign.fp.collections.MutList<E>- Specified by:
appendSomein classRrbTree<E>
-
concat
- Specified by:
concatin interfaceorg.organicdesign.fp.collections.BaseList<E>- Specified by:
concatin interfaceorg.organicdesign.fp.collections.MutList<E>- Specified by:
concatin interfaceorg.organicdesign.fp.xform.Transformable<E>- Specified by:
concatin interfaceorg.organicdesign.fp.collections.UnmodIterable<E>
-
precat
Precat is implemented here because it is a very cheap operation on an RRB-Tree. It's not implemented on PersistentVector because it is very expensive there. -
get
-
immutable
- Specified by:
immutablein interfaceorg.organicdesign.fp.collections.MutList<E>
-
indentedStr
- Specified by:
indentedStrin interfaceorg.organicdesign.fp.indent.Indented- Specified by:
indentedStrin classRrbTree<E>
-
insert
Inserts an item in the RRB tree pushing the current element at that index and all subsequent elements to the right. -
iterator
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin interfaceList<E>- Specified by:
iteratorin interfaceorg.organicdesign.fp.collections.UnmodCollection<E>- Specified by:
iteratorin interfaceorg.organicdesign.fp.collections.UnmodIterable<E>- Specified by:
iteratorin interfaceorg.organicdesign.fp.collections.UnmodList<E>- Specified by:
iteratorin interfaceorg.organicdesign.fp.collections.UnmodSortedCollection<E>- Specified by:
iteratorin interfaceorg.organicdesign.fp.collections.UnmodSortedIterable<E>- Specified by:
iteratorin classRrbTree<E>
-
toString
-
join
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. -
replace
-
without
Returns a new RrbTree minus the given item (all items to the right are shifted left one) This is O(log n). -
size
public int size()Description copied from class:RrbTree -
mt
Description copied from class:RrbTreeCreates a new empty ("M-T") tree of the appropriate (mutable/immutable) type. -
split
public org.organicdesign.fp.tuple.Tuple2<RrbTree.MutRrbt<E>,RrbTree.MutRrbt<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.
-