java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.collect.Lists |
Collection of utility functions to create of manipulate concrete or abstract lists.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Lists() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static <T> List<T> | add(List<T> dst, List<T> src) | ||||||||||
static <T> List<T> | addNonNulls(List<T> dst, List<? extends T> src) | ||||||||||
static <T> List<T> | addNonNulls(List<T> dst, T... elts) | ||||||||||
static <T> ArrayList<T> | createArrayList(T elt) | ||||||||||
static <T> ArrayList<T> | createArrayList() | ||||||||||
static <T> T |
get(List<T> list, int index)
Get the value of a list, safely returning null if the list is null or the index out-of-range.
| ||||||||||
static <T> T |
get(List<T> list, int index, T safeValue)
Get the value of a list, safely returning a providing default value if the list s null or the
index out-of-range.
| ||||||||||
static <T> T |
getFirst(List<T> list)
Get the first value of a list, safely returning null if the list is null or the index
out-of-range.
| ||||||||||
static <T, R> List<? extends R> |
map(Collection<T> input, Function<? super T, ? extends R> mapper)
Apply a 1-to-1 map operation to the elements of a collection and return the list of resulting
new elements.
| ||||||||||
static <T> List<T> |
reverse(List<T> list)
Reverse the provided input list.
| ||||||||||
static <T> ListIterator<T> |
reverseIterator(List<T> list)
Get a reverse iterator on the list.
| ||||||||||
static <T> List<T> |
subList(List<T> list, int fromIndex)
Get a tail sub-list of a list.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Get the value of a list, safely returning null if the list is null or the index out-of-range.
Get the value of a list, safely returning a providing default value if the list s null or the index out-of-range.
Get the first value of a list, safely returning null if the list is null or the index out-of-range.
Apply a 1-to-1 map operation to the elements of a collection and return the list of resulting new elements.
input | input collection |
---|---|
mapper | a map() function |
Reverse the provided input list.
list | a list |
---|
Get a reverse iterator on the list. The pointer is set to the last element of the list (if any).
Get a tail sub-list of a list.