T
- List typepublic final class ListOf<T> extends Object implements List<T>
List
.
This class should be used very carefully. You must understand that
it will fetch the entire content of the encapsulated List
on each
method call. It doesn't cache the data anyhow. If you don't
need this List
to re-fresh its content on every call,
by doing round-trips to the encapsulated iterable, decorate it with
Sticky
.
There is no thread-safety guarantee.
Sticky
Constructor and Description |
---|
ListOf(Iterable<T> src)
Ctor.
|
ListOf(Iterator<T> src)
Ctor.
|
ListOf(Scalar<List<T>> slr)
Ctor.
|
ListOf(T... array)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element) |
boolean |
add(T item) |
boolean |
addAll(Collection<? extends T> col) |
boolean |
addAll(int index,
Collection<? extends T> col) |
void |
clear() |
boolean |
contains(Object object) |
boolean |
containsAll(Collection<?> col) |
boolean |
equals(Object other) |
T |
get(int index) |
int |
hashCode() |
int |
indexOf(Object element) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
int |
lastIndexOf(Object element) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int index) |
T |
remove(int index) |
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> col) |
boolean |
retainAll(Collection<?> col) |
T |
set(int index,
T element) |
int |
size() |
List<T> |
subList(int start,
int end) |
Object[] |
toArray() |
<X> X[] |
toArray(X[] array) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
replaceAll, sort, spliterator
parallelStream, removeIf, stream
@SafeVarargs public ListOf(T... array)
array
- An array of some elementspublic boolean equals(Object other)
public int hashCode()
public int size()
public boolean isEmpty()
public boolean contains(Object object)
public Object[] toArray()
public <X> X[] toArray(X[] array)
public boolean add(T item)
public boolean remove(Object object)
public boolean containsAll(Collection<?> col)
containsAll
in interface Collection<T>
containsAll
in interface List<T>
public boolean addAll(Collection<? extends T> col)
public boolean removeAll(Collection<?> col)
public boolean retainAll(Collection<?> col)
public void clear()
public boolean addAll(int index, Collection<? extends T> col)
public int lastIndexOf(Object element)
lastIndexOf
in interface List<T>
public ListIterator<T> listIterator()
listIterator
in interface List<T>
public ListIterator<T> listIterator(int index)
listIterator
in interface List<T>
Copyright © 2017–2020 Cactoos. All rights reserved.