Constructor and Description |
---|
Lists() |
Modifier and Type | Method and Description |
---|---|
static <V> Collector<V,List<V>,List<V>> |
collector() |
static <V> IList<V> |
concat(IList<V>... lists) |
static <V> IList<V> |
concat(IList<V> a,
IList<V> b) |
static <V> boolean |
equals(IList<V> a,
IList<V> b) |
static <V> boolean |
equals(IList<V> a,
IList<V> b,
BiPredicate<V,V> equals) |
static <V> IList<V> |
from(List<V> list) |
static <V> IList<V> |
from(long size,
LongFunction<V> elementFn)
Creates a list which repeatedly uses the element function for each lookup.
|
static <V> IList<V> |
from(long size,
LongFunction<V> elementFn,
LongFunction<Iterator<V>> iteratorFn)
Creates a list which repeatedly uses the element function for each lookup.
|
static <V> IList<V> |
from(V[] array) |
static <V> long |
hash(IList<V> l) |
static <V> long |
hash(IList<V> l,
ToLongFunction<V> hash,
LongBinaryOperator combiner) |
static <V> Iterator<V> |
iterator(IList<V> list,
long startIndex) |
static <V,U> IList<U> |
lazyMap(IList<V> l,
Function<V,U> f)
Returns a list which will lazily, and repeatedly, transform each element of the input list on lookup.
|
static <V> Collector<V,LinearList<V>,LinearList<V>> |
linearCollector() |
static <V> Collector<V,LinearList<V>,LinearList<V>> |
linearCollector(int capacity) |
static <V> IList<V> |
reverse(IList<V> l) |
static <V> IList<V> |
slice(IList<V> list,
long start,
long end) |
static <V> IList<V> |
sort(IList<V> l) |
static <V> IList<V> |
sort(IList<V> l,
Comparator<V> comparator) |
static <V> List<V> |
toList(IList<V> list) |
static <V> String |
toString(IList<V> l) |
static <V> String |
toString(IList<V> l,
Function<V,String> printer) |
public static <V,U> IList<U> lazyMap(IList<V> l, Function<V,U> f)
V
- the element type for the input listU
- the element type for the result listl
- a listf
- a transform function for the elements of the listpublic static <V> boolean equals(IList<V> a, IList<V> b)
public static <V> boolean equals(IList<V> a, IList<V> b, BiPredicate<V,V> equals)
equals
- a comparison predicate for the lists of the elementpublic static <V> long hash(IList<V> l)
public static <V> long hash(IList<V> l, ToLongFunction<V> hash, LongBinaryOperator combiner)
hash
- a function which provides a hash for each elementcombiner
- a function which combines the accumulated hash and element hashpublic static <V> String toString(IList<V> l)
public static <V> String toString(IList<V> l, Function<V,String> printer)
printer
- a function which returns a string representation of an elementpublic static <V> List<V> toList(IList<V> list)
public static <V> IList<V> slice(IList<V> list, long start, long end)
start
- the inclusive start index of the sliceend
- the exclusive end index of the slicepublic static <V> IList<V> from(V[] array)
public static <V> IList<V> from(long size, LongFunction<V> elementFn)
size
- the size of the listelementFn
- a function which returns the list for the given elementpublic static <V> IList<V> from(long size, LongFunction<V> elementFn, LongFunction<Iterator<V>> iteratorFn)
size
- the size of the listelementFn
- a function which returns the list for the given elementiteratorFn
- a function which generates an iterator for the listpublic static <V> Collector<V,LinearList<V>,LinearList<V>> linearCollector()
public static <V> Collector<V,LinearList<V>,LinearList<V>> linearCollector(int capacity)
capacity
- the initial capacity of the list which collects values.public static <V> Collector<V,List<V>,List<V>> collector()
public static <V> Iterator<V> iterator(IList<V> list, long startIndex)
public static <V> IList<V> concat(IList<V> a, IList<V> b)
a
is linearpublic static <V> IList<V> sort(IList<V> l, Comparator<V> comparator)