Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Type | Name and description |
---|---|
static List |
combinations(Object[] collections) Finds all combinations of items from the given collections. |
static List |
combinations(Collection collections) @param collections the given collections |
static List |
combinations(Iterable collections) Finds all combinations of items from the given Iterable aggregate of collections. |
static T |
max(T[] items) Selects the maximum value found in an array of items, so min([2, 4, 6] as Object[]) == 6. |
static T |
max(Collection<T> items) @deprecated use max(Iterable) |
static T |
max(Iterable<T> items) Selects the maximum value found in an Iterable. |
static T |
min(T[] items) Selects the minimum value found in an array of items, so min([2, 4, 6] as Object[]) == 2. |
static T |
min(Collection<T> items) @deprecated use min(Iterable) |
static T |
min(Iterable<T> items) Selects the minimum value found in an Iterable of items. |
static Set<List<T>> |
subsequences(List<T> items) Finds all non-null subsequences of a list. |
static Object |
sum(Object[] items) Sums all the items from an array of items. |
static Object |
sum(Collection items) @deprecated use sum(Iterable) |
static Object |
sum(Iterable items) Sums all the given items. |
static List |
transpose(Object[] lists) Transposes an array of lists. |
static List |
transpose(List lists) Transposes the given lists. |
Finds all combinations of items from the given collections.
collections
- the given collectionscollections
- the given collections Finds all combinations of items from the given Iterable aggregate of collections.
So, combinations([[true, false], [true, false]])
is [[true, true], [false, true], [true, false], [false, false]]
and combinations([['a', 'b'],[1, 2, 3]])
is [['a', 1], ['b', 1], ['a', 2], ['b', 2], ['a', 3], ['b', 3]]
.
If a non-collection item is given, it is treated as a singleton collection,
i.e. combinations([[1, 2], 'x'])
is [[1, 'x'], [2, 'x']]
.
collections
- the Iterable of given collectionsSelects the maximum value found in an array of items, so min([2, 4, 6] as Object[]) == 6.
items
- an array of itemsSelects the maximum value found in an Iterable.
items
- a CollectionSelects the minimum value found in an array of items, so min([2, 4, 6] as Object[]) == 2.
items
- an array of itemsSelects the minimum value found in an Iterable of items.
items
- an Iterable Finds all non-null subsequences of a list.
E.g. subsequences([1, 2, 3])
would be:
[[1, 2, 3], [1, 3], [2, 3], [1, 2], [1], [2], [3]]
items
- the List of itemsSums all the items from an array of items.
items
- an array of itemsSums all the given items.
items
- an Iterable of itemsTransposes an array of lists.
lists
- the given lists