Package org.reactfx.util
Class SparseList<E>
java.lang.Object
org.reactfx.util.SparseList<E>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
private static interface
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ToSemigroup
<SparseList.Segment<?>, SparseList.Stats> private FingerTree
<SparseList.Segment<E>, SparseList.Stats> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate FingerTree
<SparseList.Segment<E>, SparseList.Stats> append
(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, SparseList.Segment<E> right) void
clear()
collect()
collect
(int from, int to) private static <E> FingerTree
<SparseList.Segment<E>, SparseList.Stats> get
(int index) (package private) int
getDepth()
For testing only.getOrThrow
(int index) getPresent
(int presentIndex) int
int
getPresentCountAfter
(int position) int
getPresentCountBefore
(int position) int
getPresentCountBetween
(int from, int to) javafx.scene.control.IndexRange
(package private) FingerTree
<SparseList.Segment<E>, SparseList.Stats> getTree()
For testing only.int
indexOfPresentItem
(int presentIndex) void
void
insertAll
(int position, Collection<? extends E> elems) void
insertVoid
(int position, int length) boolean
isPresent
(int index) private FingerTree
<SparseList.Segment<E>, SparseList.Stats> join
(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, List<SparseList.Segment<E>> middle, FingerTree<SparseList.Segment<E>, SparseList.Stats> right) private FingerTree
<SparseList.Segment<E>, SparseList.Stats> join
(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, FingerTree<SparseList.Segment<E>, SparseList.Stats> right) private FingerTree
<SparseList.Segment<E>, SparseList.Stats> join
(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, Tuple2<SparseList.Segment<E>, Integer> lSuffix, List<SparseList.Segment<E>> middle, Tuple2<SparseList.Segment<E>, Integer> rPrefix, FingerTree<SparseList.Segment<E>, SparseList.Stats> right) private FingerTree
<SparseList.Segment<E>, SparseList.Stats> join
(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, Tuple2<SparseList.Segment<E>, Integer> lSuffix, SparseList.Segment<E> middle, Tuple2<SparseList.Segment<E>, Integer> rPrefix, FingerTree<SparseList.Segment<E>, SparseList.Stats> right) private int
locationToPosition
(int major, int minor) void
remove
(int index) void
remove
(int from, int to) void
boolean
setIfAbsent
(int index, E elem) int
size()
void
splice
(int from, int to, Collection<? extends E> elems) void
spliceByVoid
(int from, int to, int length) private void
spliceSegments
(int from, int to, List<SparseList.Segment<E>> middle)
-
Field Details
-
SEGMENT_STATS
-
tree
-
-
Constructor Details
-
SparseList
public SparseList()
-
-
Method Details
-
emptyTree
-
size
public int size() -
getPresentCount
public int getPresentCount() -
isPresent
public boolean isPresent(int index) -
getOrThrow
-
get
-
getPresent
-
getPresentCountBefore
public int getPresentCountBefore(int position) -
getPresentCountAfter
public int getPresentCountAfter(int position) -
getPresentCountBetween
public int getPresentCountBetween(int from, int to) -
indexOfPresentItem
public int indexOfPresentItem(int presentIndex) -
getPresentItemsRange
public javafx.scene.control.IndexRange getPresentItemsRange() -
locationToPosition
private int locationToPosition(int major, int minor) -
collect
-
collect
-
clear
public void clear() -
remove
public void remove(int index) -
remove
public void remove(int from, int to) -
set
-
setIfAbsent
-
insert
-
insertAll
-
insertVoid
public void insertVoid(int position, int length) -
splice
-
spliceByVoid
public void spliceByVoid(int from, int to, int length) -
spliceSegments
-
join
private FingerTree<SparseList.Segment<E>,SparseList.Stats> join(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, Tuple2<SparseList.Segment<E>, Integer> lSuffix, SparseList.Segment<E> middle, Tuple2<SparseList.Segment<E>, Integer> rPrefix, FingerTree<SparseList.Segment<E>, SparseList.Stats> right) -
join
private FingerTree<SparseList.Segment<E>,SparseList.Stats> join(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, Tuple2<SparseList.Segment<E>, Integer> lSuffix, List<SparseList.Segment<E>> middle, Tuple2<SparseList.Segment<E>, Integer> rPrefix, FingerTree<SparseList.Segment<E>, SparseList.Stats> right) -
join
private FingerTree<SparseList.Segment<E>,SparseList.Stats> join(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, List<SparseList.Segment<E>> middle, FingerTree<SparseList.Segment<E>, SparseList.Stats> right) -
join
private FingerTree<SparseList.Segment<E>,SparseList.Stats> join(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, FingerTree<SparseList.Segment<E>, SparseList.Stats> right) -
append
private FingerTree<SparseList.Segment<E>,SparseList.Stats> append(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, SparseList.Segment<E> right) -
getDepth
int getDepth()For testing only. -
getTree
FingerTree<SparseList.Segment<E>,SparseList.Stats> getTree()For testing only.- Returns:
-