Package org.organicdesign.fp.collections
Interface ImList<E>
-
- All Superinterfaces:
BaseList<E>,java.util.Collection<E>,java.lang.Iterable<E>,java.util.List<E>,Sized,Transformable<E>,UnmodCollection<E>,UnmodIterable<E>,UnmodList<E>,UnmodSortedCollection<E>,UnmodSortedIterable<E>
- All Known Implementing Classes:
PersistentVector,RrbTree.ImRrbt
public interface ImList<E> extends BaseList<E>
Immutable copy-on-write list
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.organicdesign.fp.collections.UnmodList
UnmodList.AbstractUnmodList<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ImList<E>append(E e)Adds one item to the end of the ImList.default ImList<E>concat(java.lang.Iterable<? extends E> es)Efficiently adds items to the end of this ImList.MutableList<E>mutable()Returns a mutable list (builder)ImList<E>replace(int idx, E e)Replace the item at the given index.default ImList<E>reverse()Returns a reversed copy of this list.-
Methods inherited from interface org.organicdesign.fp.xform.Transformable
toImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableRrbt, toMutableSet, toMutableSortedMap, toMutableSortedSet
-
Methods inherited from interface org.organicdesign.fp.collections.UnmodIterable
drop, dropWhile, filter, flatMap, fold, foldUntil, map, precat, take, takeWhile
-
Methods inherited from interface org.organicdesign.fp.collections.UnmodList
add, add, addAll, addAll, clear, contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, subList, toArray, toArray
-
-
-
-
Method Detail
-
concat
default ImList<E> concat(java.lang.Iterable<? extends E> es)
Efficiently adds items to the end of this ImList.- Specified by:
concatin interfaceBaseList<E>- Specified by:
concatin interfaceTransformable<E>- Specified by:
concatin interfaceUnmodIterable<E>- Parameters:
es- the values to insert- Returns:
- a new ImList with the additional items at the end.
-
mutable
MutableList<E> mutable()
Returns a mutable list (builder)
-
replace
ImList<E> replace(int idx, E e)
Replace 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.
-
-