Top Inners Fields Constructors Methods
org.reactfx.util

public final Class SparseList<E>

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collection, .Collections, .List, .NoSuchElementException, .Optional, javafx.scene.control.IndexRange

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static interface
private static class

Field Summary

Modifier and TypeField and Description
private static final ToSemigroup<SparseList.Segment<?>, SparseList.Stats>
private FingerTree<SparseList.Segment<E>, SparseList.Stats>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private FingerTree<SparseList.Segment<E>, SparseList.Stats>
public void
public List<E>
public List<E>
collect(int from, int to)

private static <E> FingerTree<SparseList.Segment<E>, SparseList.Stats>
public Optional<E>
get(int index)

pack-priv int
getDepth()

For testing only.

public E
getOrThrow(int index)

public E
getPresent(int presentIndex)

public int
public int
getPresentCountAfter(int position)

public int
getPresentCountBefore(int position)

public int
getPresentCountBetween(int from, int to)

public IndexRange
pack-priv FingerTree<SparseList.Segment<E>, SparseList.Stats>
getTree()

For testing only.

public int
indexOfPresentItem(int presentIndex)

public void
insert(int position, E elem)

public void
insertAll(int position, Collection<? extends E> elems)

public void
insertVoid(int position, int length)

public boolean
isPresent(int index)

private FingerTree<SparseList.Segment<E>, SparseList.Stats>
private FingerTree<SparseList.Segment<E>, SparseList.Stats>
private FingerTree<SparseList.Segment<E>, SparseList.Stats>
private FingerTree<SparseList.Segment<E>, SparseList.Stats>
private int
locationToPosition(int major, int minor)

public void
remove(int index)

public void
remove(int from, int to)

public void
set(int index, E elem)

public boolean
setIfAbsent(int index, E elem)

public int
size()

public void
splice(int from, int to, Collection<? extends E> elems)

public void
spliceByVoid(int from, int to, int length)

private void
spliceSegments(int from, int to, List<SparseList.Segment<E>> middle)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SEGMENT_STATSback to summary
private static final ToSemigroup<SparseList.Segment<?>, SparseList.Stats> SEGMENT_STATS
treeback to summary
private FingerTree<SparseList.Segment<E>, SparseList.Stats> tree

Constructor Detail

SparseListback to summary
public SparseList()

Method Detail

appendback to summary
private FingerTree<SparseList.Segment<E>, SparseList.Stats> append(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, SparseList.Segment<E> right)
clearback to summary
public void clear()
collectback to summary
public List<E> collect()
collectback to summary
public List<E> collect(int from, int to)
emptyTreeback to summary
private static <E> FingerTree<SparseList.Segment<E>, SparseList.Stats> emptyTree()
getback to summary
public Optional<E> get(int index)
getDepthback to summary
pack-priv int getDepth()

For testing only.

getOrThrowback to summary
public E getOrThrow(int index)
getPresentback to summary
public E getPresent(int presentIndex)
getPresentCountback to summary
public int getPresentCount()
getPresentCountAfterback to summary
public int getPresentCountAfter(int position)
getPresentCountBeforeback to summary
public int getPresentCountBefore(int position)
getPresentCountBetweenback to summary
public int getPresentCountBetween(int from, int to)
getPresentItemsRangeback to summary
public IndexRange getPresentItemsRange()
getTreeback to summary
pack-priv FingerTree<SparseList.Segment<E>, SparseList.Stats> getTree()

For testing only.

indexOfPresentItemback to summary
public int indexOfPresentItem(int presentIndex)
insertback to summary
public void insert(int position, E elem)
insertAllback to summary
public void insertAll(int position, Collection<? extends E> elems)
insertVoidback to summary
public void insertVoid(int position, int length)
isPresentback to summary
public boolean isPresent(int index)
joinback to summary
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)
joinback to summary
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)
joinback to summary
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)
joinback to summary
private FingerTree<SparseList.Segment<E>, SparseList.Stats> join(FingerTree<SparseList.Segment<E>, SparseList.Stats> left, FingerTree<SparseList.Segment<E>, SparseList.Stats> right)
locationToPositionback to summary
private int locationToPosition(int major, int minor)
removeback to summary
public void remove(int index)
removeback to summary
public void remove(int from, int to)
setback to summary
public void set(int index, E elem)
setIfAbsentback to summary
public boolean setIfAbsent(int index, E elem)
sizeback to summary
public int size()
spliceback to summary
public void splice(int from, int to, Collection<? extends E> elems)
spliceByVoidback to summary
public void spliceByVoid(int from, int to, int length)
spliceSegmentsback to summary
private void spliceSegments(int from, int to, List<SparseList.Segment<E>> middle)
org.reactfx.util back to summary

private final Class SparseList.AbsentSegment<E>

extends Object
implements SparseList.Segment<E>
Class Inheritance
All Implemented Interfaces
org.reactfx.util.SparseList.Segment

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
pack-priv
AbsentSegment(int length)

Method Summary

Modifier and TypeMethod and Description
public List<E>
public List<E>
public Optional<E>
public int
public E
public int
public int
public boolean
public boolean
public boolean
public void
public SparseList.Segment<E>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

lengthback to summary
private int length

Constructor Detail

AbsentSegmentback to summary
pack-priv AbsentSegment(int length)

Method Detail

appendRangeToback to summary
public List<E> appendRangeTo(List<E> acc, int from, int to)

Implements org.reactfx.util.SparseList.Segment.appendRangeTo.

Annotations
@Override
appendToback to summary
public List<E> appendTo(List<E> acc)

Implements org.reactfx.util.SparseList.Segment.appendTo.

Annotations
@Override
getback to summary
public Optional<E> get(int index)

Implements org.reactfx.util.SparseList.Segment.get.

Annotations
@Override
getLengthback to summary
public int getLength()

Implements org.reactfx.util.SparseList.Segment.getLength.

Annotations
@Override
getOrThrowback to summary
public E getOrThrow(int index)

Implements org.reactfx.util.SparseList.Segment.getOrThrow.

Annotations
@Override
getPresentCountback to summary
public int getPresentCount()

Implements org.reactfx.util.SparseList.Segment.getPresentCount.

Annotations
@Override
getPresentCountBetweenback to summary
public int getPresentCountBetween(int from, int to)

Implements org.reactfx.util.SparseList.Segment.getPresentCountBetween.

Annotations
@Override
isPresentback to summary
public boolean isPresent()

Implements org.reactfx.util.SparseList.Segment.isPresent.

Annotations
@Override
isPresentback to summary
public boolean isPresent(int index)

Implements org.reactfx.util.SparseList.Segment.isPresent.

Annotations
@Override
possiblyDestructiveAppendback to summary
public boolean possiblyDestructiveAppend(SparseList.Segment<E> suffix)

Implements org.reactfx.util.SparseList.Segment.possiblyDestructiveAppend.

Annotations
@Override
setOrThrowback to summary
public void setOrThrow(int index, E elem)

Implements org.reactfx.util.SparseList.Segment.setOrThrow.

Annotations
@Override
subSegmentback to summary
public SparseList.Segment<E> subSegment(int from, int to)

Implements org.reactfx.util.SparseList.Segment.subSegment.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
org.reactfx.util back to summary

private final Class SparseList.PresentSegment<E>

extends Object
implements SparseList.Segment<E>
Class Inheritance
All Implemented Interfaces
org.reactfx.util.SparseList.Segment

Field Summary

Modifier and TypeField and Description
private final List<E>

Constructor Summary

AccessConstructor and Description
public
PresentSegment(Collection<? extends E> c)

Method Summary

Modifier and TypeMethod and Description
public List<E>
public List<E>
public Optional<E>
public int
public E
public int
public int
public boolean
public boolean
public boolean
public void
public SparseList.Segment<E>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

listback to summary
private final List<E> list

Constructor Detail

PresentSegmentback to summary
public PresentSegment(Collection<? extends E> c)

Method Detail

appendRangeToback to summary
public List<E> appendRangeTo(List<E> acc, int from, int to)

Implements org.reactfx.util.SparseList.Segment.appendRangeTo.

Annotations
@Override
appendToback to summary
public List<E> appendTo(List<E> acc)

Implements org.reactfx.util.SparseList.Segment.appendTo.

Annotations
@Override
getback to summary
public Optional<E> get(int index)

Implements org.reactfx.util.SparseList.Segment.get.

Annotations
@Override
getLengthback to summary
public int getLength()

Implements org.reactfx.util.SparseList.Segment.getLength.

Annotations
@Override
getOrThrowback to summary
public E getOrThrow(int index)

Implements org.reactfx.util.SparseList.Segment.getOrThrow.

Annotations
@Override
getPresentCountback to summary
public int getPresentCount()

Implements org.reactfx.util.SparseList.Segment.getPresentCount.

Annotations
@Override
getPresentCountBetweenback to summary
public int getPresentCountBetween(int from, int to)

Implements org.reactfx.util.SparseList.Segment.getPresentCountBetween.

Annotations
@Override
isPresentback to summary
public boolean isPresent()

Implements org.reactfx.util.SparseList.Segment.isPresent.

Annotations
@Override
isPresentback to summary
public boolean isPresent(int index)

Implements org.reactfx.util.SparseList.Segment.isPresent.

Annotations
@Override
possiblyDestructiveAppendback to summary
public boolean possiblyDestructiveAppend(SparseList.Segment<E> suffix)

Implements org.reactfx.util.SparseList.Segment.possiblyDestructiveAppend.

Annotations
@Override
setOrThrowback to summary
public void setOrThrow(int index, E elem)

Implements org.reactfx.util.SparseList.Segment.setOrThrow.

Annotations
@Override
subSegmentback to summary
public SparseList.Segment<E> subSegment(int from, int to)

Implements org.reactfx.util.SparseList.Segment.subSegment.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
org.reactfx.util back to summary

private Interface SparseList.Segment<E>

Known Direct Implementers
org.reactfx.util.SparseList.AbsentSegment, org.reactfx.util.SparseList.PresentSegment

Method Summary

Modifier and TypeMethod and Description
public List<E>
appendRangeTo(List<E> acc, int from, int to)

public List<E>
appendTo(List<E> acc)

public Optional<E>
get(int index)

public int
public E
getOrThrow(int index)

public int
public int
getPresentCountBetween(int from, int to)

public default SparseList.Stats
getStatsBetween(int from, int to)

public boolean
public boolean
isPresent(int index)

public boolean
public void
setOrThrow(int index, E elem)

public SparseList.Segment<E>
subSegment(int from, int to)

Method Detail

appendRangeToback to summary
public List<E> appendRangeTo(List<E> acc, int from, int to)
appendToback to summary
public List<E> appendTo(List<E> acc)
getback to summary
public Optional<E> get(int index)
getLengthback to summary
public int getLength()
getOrThrowback to summary
public E getOrThrow(int index)
getPresentCountback to summary
public int getPresentCount()
getPresentCountBetweenback to summary
public int getPresentCountBetween(int from, int to)
getStatsBetweenback to summary
public default SparseList.Stats getStatsBetween(int from, int to)
isPresentback to summary
public boolean isPresent()
isPresentback to summary
public boolean isPresent(int index)
possiblyDestructiveAppendback to summary
public boolean possiblyDestructiveAppend(SparseList.Segment<E> suffix)
setOrThrowback to summary
public void setOrThrow(int index, E elem)
subSegmentback to summary
public SparseList.Segment<E> subSegment(int from, int to)
org.reactfx.util back to summary

private final Class SparseList.Stats

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final int
private static final SparseList.Stats

Constructor Summary

AccessConstructor and Description
pack-priv
Stats(int size, int presentCount)

Method Summary

Modifier and TypeMethod and Description
pack-priv int
pack-priv int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

presentCountback to summary
pack-priv final int presentCount
sizeback to summary
pack-priv final int size
ZEROback to summary
private static final SparseList.Stats ZERO

Constructor Detail

Statsback to summary
pack-priv Stats(int size, int presentCount)

Method Detail

getPresentCountback to summary
pack-priv int getPresentCount()
getSizeback to summary
pack-priv int getSize()