public abstract class ImmutableSLList<T> extends java.lang.Object implements ImmutableList<T>
Constructor and Description |
---|
ImmutableSLList() |
Modifier and Type | Method and Description |
---|---|
ImmutableList<T> |
append(java.lang.Iterable<T> collection)
appends an iterable collection
|
static <T> ImmutableSLList<T> |
nil()
the empty list
|
ImmutableList<T> |
prepend(T... array)
prepends array (O(n))
|
protected ImmutableList<T> |
prepend(T[] array,
int n)
prepends the first
n elements of an array (O(n)) |
ImmutableList<T> |
prependReverse(java.lang.Iterable<T> collection)
prepends an iterable collection in reverse order, i.e.,
[4,5,6].prepend([1,2,3]) will be [3,2,1,4,5,6]
|
ImmutableList<T> |
reverse()
Reverses this list (O(N))
|
static <T> ImmutableSLList<T> |
singleton(T obj) |
ImmutableList<T> |
take(int n)
first
n elements of the list are truncated |
<S> S[] |
toArray(java.lang.Class<S> type)
Convert the list to a Java array (O(n))
|
<S> S[] |
toArray(S[] array)
Convert the list to a Java array (O(n))
|
static <T> java.util.stream.Collector<T,java.util.List<T>,ImmutableList<T>> |
toImmutableList() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static <T> ImmutableSLList<T> nil()
public static <T> ImmutableSLList<T> singleton(T obj)
public ImmutableList<T> reverse()
reverse
in interface ImmutableList<T>
public <S> S[] toArray(S[] array)
toArray
in interface ImmutableList<T>
public <S> S[] toArray(java.lang.Class<S> type)
toArray
in interface ImmutableList<T>
public ImmutableList<T> prepend(T... array)
prepend
in interface ImmutableList<T>
array
- the array of the elements to be prependedprotected ImmutableList<T> prepend(T[] array, int n)
n
elements of an array (O(n))array
- the array of the elements to be prependedn
- an int specifying the number of elements to be prependedpublic ImmutableList<T> append(java.lang.Iterable<T> collection)
ImmutableList
append
in interface ImmutableList<T>
public ImmutableList<T> prependReverse(java.lang.Iterable<T> collection)
ImmutableList
prependReverse
in interface ImmutableList<T>
public ImmutableList<T> take(int n)
n
elements of the list are truncatedtake
in interface ImmutableList<T>
n
- an int specifying the number of elements to be truncatedn
elementspublic static <T> java.util.stream.Collector<T,java.util.List<T>,ImmutableList<T>> toImmutableList()
Copyright © 2003-2019 The KeY-Project.