public class FrozenList<E> extends Object implements List<E>, FrozenCollection<E>
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e)
not supported since this list is immutable!
|
void |
add(int index,
E element)
not supported since this list is immutable!
|
boolean |
addAll(Collection<? extends E> c)
not supported since this list is immutable!
|
boolean |
addAll(int index,
Collection<? extends E> c)
not supported since this list is immutable!
|
void |
clear()
not supported since this list is immutable!
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
static <E> FrozenList<E> |
empty()
A safe way to retrieve an empty, shared, immutable list instance.
|
static <E> FrozenList<E> |
from(Collection<E> c)
Construct an instance holding the elements of the given collection.
|
static <E> FrozenList<E> |
from(E... e)
Construct an instance holding the elements supplied by the given varargs array.
|
static <E> FrozenList<E> |
from(Iterator<E> i)
Construct an instance holding the elements supplied by the given
Iterator |
E |
get(int index) |
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator<E> |
iterator()
Returns an unmodifiable iterator over the elements in this list in proper sequence.
|
int |
lastIndexOf(Object o) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
E |
remove(int index)
not supported since this list is immutable!
|
boolean |
remove(Object o)
not supported since this list is immutable!
|
boolean |
removeAll(Collection<?> c)
not supported since this list is immutable!
|
boolean |
retainAll(Collection<?> c)
not supported since this list is immutable!
|
E |
set(int index,
E element)
not supported since this list is immutable!
|
int |
size() |
List<E> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public static <E> FrozenList<E> from(Collection<E> c)
c
- holds the elements to be added. Passing null
leads to an empty
FrozenList
being created.public static <E> FrozenList<E> from(Iterator<E> i)
Iterator
i
- holds the elements to be added. Passing null
leads to an empty
FrozenList
being created.public static <E> FrozenList<E> from(E... e)
e
- holds the elements to be added. Passing null
leads to an empty
FrozenList
being created.public static <E> FrozenList<E> empty()
E
- public int size()
public boolean isEmpty()
public boolean contains(Object o)
public Iterator<E> iterator()
public Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean add(E e)
add
in interface Collection<E>
add
in interface List<E>
e
- UnsupportedOperationException
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface List<E>
o
- UnsupportedOperationException
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface List<E>
public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
addAll
in interface List<E>
c
- UnsupportedOperationException
public boolean addAll(int index, Collection<? extends E> c)
addAll
in interface List<E>
index
- c
- UnsupportedOperationException
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface List<E>
c
- UnsupportedOperationException
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface List<E>
c
- UnsupportedOperationException
public void clear()
clear
in interface Collection<E>
clear
in interface List<E>
UnsupportedOperationException
public E set(int index, E element)
set
in interface List<E>
index
- element
- UnsupportedOperationException
public void add(int index, E element)
add
in interface List<E>
index
- element
- UnsupportedOperationException
public E remove(int index)
remove
in interface List<E>
index
- UnsupportedOperationException
public int lastIndexOf(Object o)
lastIndexOf
in interface List<E>
public ListIterator<E> listIterator()
listIterator
in interface List<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
Copyright © 2024 levigo holding gmbh. All rights reserved.