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, use
StickyList
.
There is no thread-safety guarantee.
StickyList
Constructor and Description |
---|
ListOf(Iterable<T> src)
Ctor.
|
ListOf(T... array)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element) |
boolean |
add(T element) |
boolean |
addAll(Collection<? extends T> collection) |
boolean |
addAll(int index,
Collection<? extends T> collection) |
void |
clear() |
boolean |
contains(Object object) |
boolean |
containsAll(Collection<?> collection) |
T |
get(int index) |
int |
indexOf(Object object) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
int |
lastIndexOf(Object object) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int index) |
T |
remove(int index) |
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> collection) |
boolean |
retainAll(Collection<?> collection) |
T |
set(int index,
T element) |
int |
size() |
List<T> |
subList(int from,
int end) |
Object[] |
toArray() |
<Y> Y[] |
toArray(Y[] array) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
@SafeVarargs public ListOf(T... array)
array
- An array of some elementspublic int size()
public boolean isEmpty()
public boolean contains(Object object)
public Object[] toArray()
public <Y> Y[] toArray(Y[] array)
public boolean add(T element)
public boolean remove(Object object)
public boolean containsAll(Collection<?> collection)
containsAll
in interface Collection<T>
containsAll
in interface List<T>
public boolean addAll(Collection<? extends T> collection)
public boolean addAll(int index, Collection<? extends T> collection)
public boolean removeAll(Collection<?> collection)
public boolean retainAll(Collection<?> collection)
public void clear()
public int lastIndexOf(Object object)
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 Cactoos. All rights reserved.