public final class Arrays extends Object
| Modifier and Type | Method and Description |
|---|---|
static <A> A[] |
append(Class<A> type,
A[] as,
A a)
Create a new array by appending
a to as: [as0, as1, .. |
static <A> A[] |
array(A... as)
Create an array from the vararg parameter list.
|
static <A> A[] |
cons(Class<A> type,
A a,
A[] as)
Create a new array by prepending
a to as: [a, as0, as1, .. |
static <A> Function<A[],Option<A>> |
head()
Functional version of
head(Object[]). |
static <A> Option<A> |
head(A[] as)
Return the head of array
as or none. |
static <A> String |
mkString(A[] as,
String sep)
Make a string from a collection separating each element by
sep. |
static <A> Function<A,A[]> |
singleton(Class<A> type)
Turn a value into a single element array.
|
static <A> Function<A[],A[]> |
sort()
Functional version of
sort(A[]). |
static <A> A[] |
sort(A[] as)
Sort array
as according to the natural ordering. |
static <A> Function<A[],List<A>> |
toList() |
public static <A> Option<A> head(A[] as)
as or none.public static <A> A[] sort(A[] as)
as according to the natural ordering. Note that as gets
mutated!asArrays.sort(Object[])public static <A> A[] cons(Class<A> type, A a, A[] as)
a to as: [a, as0, as1, .. asn]public static <A> A[] append(Class<A> type, A[] as, A a)
a to as: [as0, as1, .. asn, a].public static <A> A[] array(A... as)
public static <A> Function<A,A[]> singleton(Class<A> type)
public static <A> Function<A[],Option<A>> head()
head(Object[]).Copyright © 2009–2021 Opencast Project. All rights reserved.