E
- public class TreePVector<E> extends AbstractList<E> implements PVector<E>, Serializable
This implementation is backed by an IntTreePMap and supports logarithmic-time querying, setting, insertion, and removal.
This implementation is thread-safe (assuming Java's AbstractList is thread-safe) although its iterators may not be.
modCount
Modifier and Type | Method and Description |
---|---|
static <E> TreePVector<E> |
empty() |
static <E> TreePVector<E> |
from(Collection<? extends E> list) |
E |
get(int index) |
Iterator<E> |
iterator() |
TreePVector<E> |
minus(int i) |
TreePVector<E> |
minus(Object e)
Returns a sequence consisting of the elements of this without the first occurrence of e.
|
TreePVector<E> |
minusAll(Collection<?> list) |
TreePVector<E> |
plus(E e)
Returns a vector consisting of the elements of this with e appended.
|
TreePVector<E> |
plus(int i,
E e) |
TreePVector<E> |
plusAll(Collection<? extends E> list)
Returns a vector consisting of the elements of this with list appended.
|
TreePVector<E> |
plusAll(int i,
Collection<? extends E> list) |
static <E> TreePVector<E> |
singleton(E e) |
int |
size() |
TreePVector<E> |
subList(int start,
int end) |
PVector<E> |
with(int i,
E e) |
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, clear, remove, removeAll, retainAll
add, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public static <E> TreePVector<E> empty()
E
- public static <E> TreePVector<E> singleton(E e)
E
- e
- public static <E> TreePVector<E> from(Collection<? extends E> list)
E
- list
- public int size()
size
in interface Collection<E>
size
in interface List<E>
size
in class AbstractCollection<E>
public E get(int index)
public TreePVector<E> subList(int start, int end)
public TreePVector<E> plus(E e)
PVector
public TreePVector<E> plus(int i, E e)
public TreePVector<E> minus(Object e)
PSequence
public TreePVector<E> minus(int i)
public TreePVector<E> plusAll(Collection<? extends E> list)
PVector
public TreePVector<E> minusAll(Collection<?> list)
public TreePVector<E> plusAll(int i, Collection<? extends E> list)
Copyright © 2019. All rights reserved.