Package org.organicdesign.fp.collections
Class PersistentVector.MutVector<F>
- java.lang.Object
-
- org.organicdesign.fp.collections.AbstractUnmodIterable<E>
-
- org.organicdesign.fp.collections.UnmodList.AbstractUnmodList<F>
-
- org.organicdesign.fp.collections.PersistentVector.MutVector<F>
-
- All Implemented Interfaces:
Iterable<F>,Collection<F>,List<F>,BaseList<F>,MutList<F>,Sized,UnmodCollection<F>,UnmodIterable<F>,UnmodList<F>,UnmodSortedCollection<F>,UnmodSortedIterable<F>,Transformable<F>
- Enclosing class:
- PersistentVector<E>
public static final class PersistentVector.MutVector<F> extends UnmodList.AbstractUnmodList<F> implements MutList<F>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.organicdesign.fp.collections.UnmodIterable
UnmodIterable.UnIterable
-
Nested classes/interfaces inherited from interface org.organicdesign.fp.collections.UnmodList
UnmodList.AbstractUnmodList<E>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull MutList<F>append(F val)Adds the item to the end of this list (mutating it in place).@NotNull MutList<F>appendSome(@NotNull Fn0<? extends @NotNull Option<F>> supplier)If supplier returns Some, append the additional item to the end of this MutList (modifying it in place).Fget(int i)PersistentVector<F>immutable()Returns an immutable version of this mutable list.@NotNull MutList<F>replace(int idx, F e)Replace the item at the given index.intsize()Returns the number of items in this collection or iterable.-
Methods inherited from class org.organicdesign.fp.collections.UnmodList.AbstractUnmodList
equals, hashCode
-
Methods inherited from class org.organicdesign.fp.collections.AbstractUnmodIterable
toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
equals, hashCode, spliterator
-
Methods inherited from interface org.organicdesign.fp.collections.MutList
add, addAll, concat, reverse
-
Methods inherited from interface org.organicdesign.fp.xform.Transformable
any, toImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutList, toMutMap, toMutRrbt, toMutSet, toMutSortedMap, toMutSortedSet
-
Methods inherited from interface org.organicdesign.fp.collections.UnmodIterable
drop, dropWhile, filter, flatMap, fold, foldUntil, map, precat, take, takeWhile, whereNonNull
-
Methods inherited from interface org.organicdesign.fp.collections.UnmodList
add, addAll, clear, contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, subList, toArray, toArray
-
-
-
-
Method Detail
-
size
public int size()
Description copied from interface:SizedReturns the number of items in this collection or iterable.
-
immutable
public PersistentVector<F> immutable()
Description copied from interface:MutListReturns an immutable version of this mutable list.
-
append
@Contract(mutates="this") @NotNull public @NotNull MutList<F> append(F val)
Description copied from interface:MutListAdds the item to the end of this list (mutating it in place).
-
appendSome
@Contract(mutates="this") @NotNull public @NotNull MutList<F> appendSome(@NotNull @NotNull Fn0<? extends @NotNull Option<F>> supplier)
If supplier returns Some, append the additional item to the end of this MutList (modifying it in place). If None, just return this MutList unmodified.- Specified by:
appendSomein interfaceBaseList<F>- Specified by:
appendSomein interfaceMutList<F>- Parameters:
supplier- returnOption.Someto append,Nonefor a no-op.
-
replace
@Contract(mutates="this") @NotNull public @NotNull MutList<F> replace(int idx, F e)
Description copied from interface:MutListReplace the item at the given index. Note: i.replace(i.size(), o) used to be equivalent to i.concat(o), but it probably won't be for the RRB tree implementation, so this will change too.
-
-