- java.lang.Object
-
- swim.collections.STreeContext<T>
-
- swim.collections.STreeList<T>
-
- All Implemented Interfaces:
Cloneable,Iterable<T>,Collection<T>,List<T>,swim.codec.Debug,swim.util.KeyedList<T>
public class STreeList<T> extends STreeContext<T> implements swim.util.KeyedList<T>, Cloneable, swim.codec.Debug
Mutable, thread-safeKeyedListbacked by an S-Tree.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, T newValue)voidadd(int index, T newValue, Object key)booleanadd(T newValue)booleanadd(T newValue, Object key)booleanaddAll(int index, Collection<? extends T> newValues)booleanaddAll(Collection<? extends T> newValues)voidclear()STree<T>clone()booleancontains(Object value)booleancontainsAll(Collection<?> values)protected STree<T>copy(STreePage<T> root)voiddebug(swim.codec.Output<?> output)voiddrop(int lower)static <T> STreeList<T>empty()swim.util.Cursor<Map.Entry<Object,T>>entryIterator()booleanequals(Object other)Tget(int index)Tget(int index, Object key)Map.Entry<Object,T>getEntry(int index)Map.Entry<Object,T>getEntry(int index, Object key)inthashCode()intindexOf(Object value)booleanisEmpty()swim.util.Cursor<T>iterator()swim.util.Cursor<Object>keyIterator()intlastIndexOf(Object value)swim.util.Cursor<T>listIterator()swim.util.Cursor<T>listIterator(int index)protected intlookup(int start, Object key)voidmove(int fromIndex, int toIndex)voidmove(int fromIndex, int toIndex, Object key)static <T> STree<T>of(T... values)Tremove(int index)Tremove(int index, Object key)booleanremove(Object value)booleanremoveAll(Collection<?> values)booleanretainAll(Collection<?> values)swim.util.Cursor<Map.Entry<Object,T>>reverseEntryIterator()swim.util.Cursor<T>reverseIterator()swim.util.Cursor<Object>reverseKeyIterator()Tset(int index, T newValue)Tset(int index, T newValue, Object key)intsize()STree<T>snapshot()List<T>subList(int fromIndex, int toIndex)voidtake(int keep)Object[]toArray()<U> U[]toArray(U[] array)StringtoString()-
Methods inherited from class swim.collections.STreeContext
compare, identify, pageShouldMerge, pageShouldSplit, pageSplitSize
-
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
-
empty
public static <T> STreeList<T> empty()
-
of
public static <T> STree<T> of(T... values)
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
contains
public boolean contains(Object value)
-
containsAll
public boolean containsAll(Collection<?> values)
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceList<T>
-
lastIndexOf
public int lastIndexOf(Object value)
- Specified by:
lastIndexOfin interfaceList<T>
-
getEntry
public Map.Entry<Object,T> getEntry(int index)
- Specified by:
getEntryin interfaceswim.util.KeyedList<T>
-
getEntry
public Map.Entry<Object,T> getEntry(int index, Object key)
- Specified by:
getEntryin interfaceswim.util.KeyedList<T>
-
set
public T set(int index, T newValue, Object key)
- Specified by:
setin interfaceswim.util.KeyedList<T>
-
add
public boolean add(T newValue)
-
add
public boolean add(T newValue, Object key)
- Specified by:
addin interfaceswim.util.KeyedList<T>
-
addAll
public boolean addAll(Collection<? extends T> newValues)
-
add
public void add(int index, T newValue, Object key)- Specified by:
addin interfaceswim.util.KeyedList<T>
-
addAll
public boolean addAll(int index, Collection<? extends T> newValues)
-
remove
public T remove(int index, Object key)
- Specified by:
removein interfaceswim.util.KeyedList<T>
-
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)- Specified by:
movein interfaceswim.util.KeyedList<T>
-
move
public void move(int fromIndex, int toIndex, Object key)- Specified by:
movein interfaceswim.util.KeyedList<T>
-
drop
public void drop(int lower)
-
take
public void take(int keep)
-
clear
public void clear()
-
toArray
public Object[] toArray()
-
toArray
public <U> U[] toArray(U[] array)
-
iterator
public swim.util.Cursor<T> iterator()
-
listIterator
public swim.util.Cursor<T> listIterator()
- Specified by:
listIteratorin interfaceList<T>
-
listIterator
public swim.util.Cursor<T> listIterator(int index)
- Specified by:
listIteratorin interfaceList<T>
-
keyIterator
public swim.util.Cursor<Object> keyIterator()
- Specified by:
keyIteratorin interfaceswim.util.KeyedList<T>
-
entryIterator
public swim.util.Cursor<Map.Entry<Object,T>> entryIterator()
- Specified by:
entryIteratorin interfaceswim.util.KeyedList<T>
-
reverseIterator
public swim.util.Cursor<T> reverseIterator()
-
reverseKeyIterator
public swim.util.Cursor<Object> reverseKeyIterator()
-
lookup
protected int lookup(int start, Object key)
-
equals
public boolean equals(Object other)
-
hashCode
public int hashCode()
-
debug
public void debug(swim.codec.Output<?> output)
- Specified by:
debugin interfaceswim.codec.Debug
-
-