public class SingletonList<E> extends AbstractList<E> implements RandomAccess, Serializable
modCount
Constructor and Description |
---|
SingletonList(E o) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Object obj) |
static <E> SingletonList<E> |
create(E o) |
void |
forEach(Consumer<? super E> action) |
E |
get(int index) |
Iterator<E> |
iterator() |
boolean |
removeIf(Predicate<? super E> filter) |
void |
replaceAll(UnaryOperator<E> operator) |
int |
size() |
void |
sort(Comparator<? super E> c) |
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, containsAll, isEmpty, remove, removeAll, retainAll, spliterator, toArray, toArray
parallelStream, stream
public SingletonList(E o)
public static <E> SingletonList<E> create(E o)
public int size()
size
in interface Collection<E>
size
in interface List<E>
size
in class AbstractCollection<E>
public boolean contains(Object obj)
contains
in interface Collection<E>
contains
in interface List<E>
contains
in class AbstractCollection<E>
public E get(int index)
public boolean removeIf(Predicate<? super E> filter)
removeIf
in interface Collection<E>
public void replaceAll(UnaryOperator<E> operator)
replaceAll
in interface List<E>
public void sort(Comparator<? super E> c)
Copyright © 2024. All rights reserved.