- java.lang.Object
-
- swim.collections.STreeContext<T>
-
- swim.collections.STree<T>
-
public class STree<T> extends STreeContext<T> implements KeyedList<T>, Cloneable, Debug
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T newValue)
void
add(int index, T newValue, Object key)
boolean
add(T newValue)
boolean
add(T newValue, Object key)
boolean
addAll(int index, Collection<? extends T> newValues)
boolean
addAll(Collection<? extends T> newValues)
STree<T>
appended(T newValue)
STree<T>
appended(T newValue, Object key)
void
clear()
STree<T>
clone()
protected int
compare(Object x, Object y)
boolean
contains(Object value)
boolean
containsAll(Collection<?> values)
protected STree<T>
copy(STreePage<T> root)
<U> Output<U>
debug(Output<U> output)
Writes a developer readable, debug-formatted string representation of this object tooutput
.void
drop(int lower)
static <T> STree<T>
empty()
Cursor<Map.Entry<Object,T>>
entryIterator()
boolean
equals(Object other)
T
get(int index)
T
get(int index, Object key)
Map.Entry<Object,T>
getEntry(int index)
Map.Entry<Object,T>
getEntry(int index, Object key)
int
hashCode()
protected Object
identify(T value)
int
indexOf(Object value)
STree<T>
inserted(int index, T newValue)
STree<T>
inserted(int index, T newValue, Object key)
boolean
isEmpty()
Cursor<T>
iterator()
Cursor<Object>
keyIterator()
int
lastIndexOf(Object value)
Cursor<T>
listIterator()
Cursor<T>
listIterator(int index)
protected int
lookup(int start, Object key)
void
move(int fromIndex, int toIndex)
void
move(int fromIndex, int toIndex, Object key)
static <T> STree<T>
of(T... values)
protected boolean
pageShouldMerge(STreePage<T> page)
protected boolean
pageShouldSplit(STreePage<T> page)
protected int
pageSplitSize()
T
remove(int index)
T
remove(int index, Object key)
boolean
remove(Object value)
boolean
removeAll(Collection<?> values)
STree<T>
removed(int index)
STree<T>
removed(int index, Object key)
STree<T>
removed(Object value)
boolean
retainAll(Collection<?> values)
Cursor<Map.Entry<Object,T>>
reverseEntryIterator()
Cursor<T>
reverseIterator()
Cursor<Object>
reverseKeyIterator()
T
set(int index, T newValue)
T
set(int index, T newValue, Object key)
int
size()
List<T>
subList(int fromIndex, int toIndex)
void
take(int upper)
Object[]
toArray()
<U> U[]
toArray(U[] array)
String
toString()
STree<T>
updated(int index, T newValue)
STree<T>
updated(int index, T newValue, Object key)
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
contains
public boolean contains(Object value)
-
containsAll
public boolean containsAll(Collection<?> values)
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
lastIndexOf
public int lastIndexOf(Object value)
- Specified by:
lastIndexOf
in interfaceList<T>
-
add
public boolean add(T newValue)
-
addAll
public boolean addAll(Collection<? extends T> newValues)
-
addAll
public boolean addAll(int index, Collection<? extends T> newValues)
-
remove
public boolean remove(Object value)
-
removeAll
public boolean removeAll(Collection<?> values)
-
retainAll
public boolean retainAll(Collection<?> values)
-
move
public void move(int fromIndex, int toIndex, Object key)
-
drop
public void drop(int lower)
-
take
public void take(int upper)
-
clear
public void clear()
-
toArray
public Object[] toArray()
-
toArray
public <U> U[] toArray(U[] array)
-
listIterator
public Cursor<T> listIterator()
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
public Cursor<T> listIterator(int index)
- Specified by:
listIterator
in interfaceList<T>
-
keyIterator
public Cursor<Object> keyIterator()
- Specified by:
keyIterator
in interfaceKeyedList<T>
-
entryIterator
public Cursor<Map.Entry<Object,T>> entryIterator()
- Specified by:
entryIterator
in interfaceKeyedList<T>
-
identify
protected Object identify(T value)
- Overrides:
identify
in classSTreeContext<T>
-
compare
protected int compare(Object x, Object y)
- Overrides:
compare
in classSTreeContext<T>
-
pageSplitSize
protected int pageSplitSize()
- Overrides:
pageSplitSize
in classSTreeContext<T>
-
pageShouldSplit
protected boolean pageShouldSplit(STreePage<T> page)
- Overrides:
pageShouldSplit
in classSTreeContext<T>
-
pageShouldMerge
protected boolean pageShouldMerge(STreePage<T> page)
- Overrides:
pageShouldMerge
in classSTreeContext<T>
-
lookup
protected int lookup(int start, Object key)
-
equals
public boolean equals(Object other)
-
hashCode
public int hashCode()
-
debug
public <U> Output<U> debug(Output<U> output)
Description copied from interface:Debug
Writes a developer readable, debug-formatted string representation of this object tooutput
.
-
empty
public static <T> STree<T> empty()
-
of
public static <T> STree<T> of(T... values)
-
-