public class PersistentVector<E> extends UnmodList.AbstractUnmodList<E> implements ImList<E>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
PersistentVector.MutableVector<F> |
UnmodList.AbstractUnmodList<E>
Modifier and Type | Field and Description |
---|---|
static PersistentVector<?> |
EMPTY |
Modifier and Type | Method and Description |
---|---|
PersistentVector<E> |
append(E val)
Inserts a new item at the end of the Vecsicle.
|
PersistentVector<E> |
concat(Iterable<? extends E> items)
Efficiently adds items to the end of this PersistentVector.
|
static <T> PersistentVector<T> |
empty()
Returns the empty ImList (there only needs to be one)
|
static <T> PersistentVector.MutableVector<T> |
emptyMutable()
Returns a new mutable vector.
|
E |
get(int i)
Returns the item specified by the given index.
|
UnmodListIterator<E> |
listIterator(int index)
Subclasses should override this when they can do so more efficiently.
|
PersistentVector.MutableVector<E> |
mutable()
Returns a mutable list (builder)
|
static <T> PersistentVector<T> |
ofIter(Iterable<T> items)
Public static factory method to create a vector from an Iterable.
|
PersistentVector<E> |
replace(int i,
E val)
Replace the item at the given index.
|
int |
size()
Returns the number of items in this collection or iterable.
|
equals, hashCode
toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, addAll, addAll, clear, contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, permutations, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, subList, toArray, toArray
equals, hashCode, spliterator
parallelStream, stream
castFromList, castFromSortedMap, castFromSortedSet, equal
drop, dropWhile, filter, flatMap, fold, foldUntil, hash, map, precat, take, takeWhile, toString
toImList, toImMap, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableSet, toMutableSortedMap, toMutableSortedSet
public static final PersistentVector<?> EMPTY
public static <T> PersistentVector<T> empty()
public static <T> PersistentVector.MutableVector<T> emptyMutable()
public static <T> PersistentVector<T> ofIter(Iterable<T> items)
StaticImports.vec(Object...)
.public PersistentVector.MutableVector<E> mutable()
ImList
public E get(int i)
public PersistentVector<E> replace(int i, E val)
public int size()
public PersistentVector<E> append(E val)
public PersistentVector<E> concat(Iterable<? extends E> items)
concat
in interface BaseList<E>
concat
in interface ImList<E>
concat
in interface UnmodIterable<E>
concat
in interface Transformable<E>
items
- the values to insertpublic UnmodListIterator<E> listIterator(int index)
listIterator
in interface List<E>
listIterator
in interface UnmodList<E>
Copyright © 2017. All rights reserved.