Package org.sosy_lab.common.collect
Interface PersistentList<T>
- Type Parameters:
T- The type of values.
- All Superinterfaces:
Collection<T>,Iterable<T>,List<T>
- All Known Implementing Classes:
PersistentLinkedList
Interface for persistent lists. A persistent data structure is immutable, but provides cheap
copy-and-write operations. Thus all write operations ({
with(Object), {without(Object)}) will not modify the current instance, but return a new instance instead.
All modifying operations inherited from List are not supported and will always throw
UnsupportedOperationException.
Instances of this interface are thread-safe as long as published safely.
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Unsupported operation.booleanDeprecated.Unsupported operation.booleanaddAll(int pIndex, Collection<? extends T> pC) Deprecated.Unsupported operation.booleanaddAll(Collection<? extends T> pC) Deprecated.Unsupported operation.voidclear()Deprecated.Unsupported operation.empty()Replacement for {clear()that returns an empty instance.remove(int pIndex) Deprecated.Unsupported operation.booleanDeprecated.Unsupported operation.booleanremoveAll(Collection<?> pC) Deprecated.Unsupported operation.voidreplaceAll(UnaryOperator<T> pOperator) Deprecated.Unsupported operation.booleanretainAll(Collection<?> pC) Deprecated.Unsupported operation.reversed()Returns a new list with the elements in the reverse order.Deprecated.Unsupported operation.voidsort(Comparator<? super T> pC) Deprecated.Unsupported operation.Replacement foradd(Object)that returns a fresh new instance.Replacement foraddAll(Collection)that returns a fresh new instance.Replacement forremove(Object)that returns a fresh new instance.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, size, spliterator, subList, toArray, toArray
-
Method Details
-
with
Replacement foradd(Object)that returns a fresh new instance. The position of insertion is not specified. -
withAll
Replacement foraddAll(Collection)that returns a fresh new instance. The position of insertion is not specified. -
without
Replacement forremove(Object)that returns a fresh new instance. If the value occurs several times, only the first occurrence is removed. -
empty
Replacement for {clear()that returns an empty instance. -
reversed
Returns a new list with the elements in the reverse order. -
add
Deprecated.Unsupported operation.- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
add
Deprecated.Unsupported operation.- Specified by:
addin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
addAll
Deprecated.Unsupported operation.- Specified by:
addAllin interfaceCollection<T>- Specified by:
addAllin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
addAll
Deprecated.Unsupported operation.- Specified by:
addAllin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
clear
Deprecated.Unsupported operation.- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
remove
Deprecated.Unsupported operation.- Specified by:
removein interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
remove
Deprecated.Unsupported operation.- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
removeAll
Deprecated.Unsupported operation.- Specified by:
removeAllin interfaceCollection<T>- Specified by:
removeAllin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
replaceAll
Deprecated.Unsupported operation.- Specified by:
replaceAllin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
retainAll
Deprecated.Unsupported operation.- Specified by:
retainAllin interfaceCollection<T>- Specified by:
retainAllin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
set
Deprecated.Unsupported operation.- Specified by:
setin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-
sort
Deprecated.Unsupported operation.- Specified by:
sortin interfaceList<T>- Throws:
UnsupportedOperationException- Always.
-