public class BfLists extends Object
| Constructor and Description |
|---|
BfLists() |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
assoc(List<T> list,
int idx,
T val)
Return an updated list with the specified value at the specified index.
|
static <T> List<T> |
insert(List<T> list,
int idx,
T val)
Return an updated list with the specified value at the specified index inserted.
|
static <T> List<T> |
list(T... elements)
Generates list primitive.
|
static <T> List<T> |
merge(Collection<T>... lists)
combine all collections given into one immutable list.
|
static <T> List<T> |
push(List<T> list,
T... end)
Add elements to the end of a list.
|
static <T> List<T> |
remove(List<T> list,
int idx)
Return an updated list with the specified value at the specified index removed.
|
static <T> List<T> |
unshift(List<T> list,
T... head)
Add elements to the beginning of a list.
|
public static <T> List<T> list(T... elements)
elements - elements to add.public static <T> List<T> merge(Collection<T>... lists)
lists - public static <T> List<T> assoc(List<T> list, int idx, T val)
list - The list to create a new version ofidx - the index for the valueval - the new valuepublic static <T> List<T> remove(List<T> list, int idx)
list - The list to create a new version ofidx - the index for the valuepublic static <T> List<T> insert(List<T> list, int idx, T val)
list - The list to create a new version ofidx - the index for the valuepublic static <T> List<T> push(List<T> list, T... end)
list - The list to add to.end - The elements to add.Copyright © 2016. All rights reserved.