public abstract class Groups extends Object
| Constructor and Description |
|---|
Groups() |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> Map<K,List<V>> |
groupBy(Iterable<V> groupies,
Delegate<K,V> grouper)
Groups elements from an iterable in the key evaluated from the passed
delegate.
|
static <C extends Collection<V>,K,V> |
groupBy(Iterable<V> groupies,
Delegate<K,V> grouper,
Provider<C> collectionProvider)
Groups elements from an iterable in the key evaluated from the passed
delegate.
|
static <M extends Map<K,C>,C extends Collection<V>,K,V> |
groupBy(Iterable<V> groupies,
Delegate<K,V> grouper,
Provider<C> collectionProvider,
Provider<M> mapProvider)
Groups elements from an iterable in the key evaluated from the passed
delegate.
|
static <K,V> Map<K,List<V>> |
groupBy(Iterator<V> groupies,
Delegate<K,V> grouper)
Groups elements from an iterator in the key evaluated from the passed
delegate.
|
static <C extends Collection<V>,K,V> |
groupBy(Iterator<V> groupies,
Delegate<K,V> grouper,
Provider<C> collectionProvider)
Groups elements from an iterator in the key evaluated from the passed
delegate.
|
static <M extends Map<K,C>,C extends Collection<V>,K,V> |
groupBy(Iterator<V> groupies,
Delegate<K,V> grouper,
Provider<C> collectionProvider,
Provider<M> mapProvider)
Groups elements from an iterator in the key evaluated from the passed
delegate.
|
static <K,V> Map<K,List<V>> |
groupBy(V[] groupies,
Delegate<K,V> grouper)
Groups elements from an array in the key evaluated from the passed
delegate.
|
static <C extends Collection<V>,K,V> |
groupBy(V[] groupies,
Delegate<K,V> grouper,
Provider<C> collectionProvider)
Groups elements from an array in the key evaluated from the passed
delegate.
|
static <M extends Map<K,C>,C extends Collection<V>,K,V> |
groupBy(V[] groupies,
Delegate<K,V> grouper,
Provider<C> collectionProvider,
Provider<M> mapProvider)
Groups elements from an array in the key evaluated from the passed
delegate.
|
static <K,V> Map<K,V> |
indexBy(Iterable<V> groupies,
Delegate<K,V> indexer)
Indexes elements from the iterable using passed delegate.
|
static <M extends Map<K,V>,K,V> |
indexBy(Iterable<V> groupies,
Delegate<K,V> indexer,
Provider<M> mapProvider)
Indexes elements from the iterable using passed delegate.
|
static <K,V> Map<K,V> |
indexBy(Iterator<V> groupies,
Delegate<K,V> indexer)
Indexes elements from the iterator using passed delegate.
|
static <M extends Map<K,V>,K,V> |
indexBy(Iterator<V> groupies,
Delegate<K,V> indexer,
Provider<M> mapProvider)
Indexes elements from the iterator using passed delegate.
|
static <K,V> Map<K,V> |
indexBy(V[] groupies,
Delegate<K,V> indexer)
Indexes elements from the array using passed delegate.
|
static <M extends Map<K,V>,K,V> |
indexBy(V[] groupies,
Delegate<K,V> indexer,
Provider<M> mapProvider)
Indexes elements from the array using passed delegate.
|
static <T> Pair<List<T>,List<T>> |
partition(Iterable<T> values,
Predicate<T> partitioner)
Partitions elements from the iterable into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
static <C extends Collection<T>,T> |
partition(Iterable<T> values,
Predicate<T> partitioner,
Provider<C> collectionsProvider)
Partitions elements from the iterable into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
static <CA extends Collection<T>,CR extends Collection<T>,T> |
partition(Iterable<T> values,
Predicate<T> partitioner,
Provider<CA> acceptedCollectionProvider,
Provider<CR> refusedCollectionProvider)
Partitions elements from the iterable into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
static <T> Pair<List<T>,List<T>> |
partition(Iterator<T> values,
Predicate<T> partitioner)
Partitions elements from the iterator into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
static <C extends Collection<T>,T> |
partition(Iterator<T> values,
Predicate<T> partitioner,
Provider<C> collectionsProvider)
Partitions elements from the iterator into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
static <CA extends Collection<T>,CR extends Collection<T>,T> |
partition(Iterator<T> values,
Predicate<T> partitioner,
Provider<CA> acceptedCollectionProvider,
Provider<CR> refusedCollectionProvider)
Partitions elements from the iterator into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
static <T> Pair<List<T>,List<T>> |
partition(T[] values,
Predicate<T> partitioner)
Partitions elements from the array into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
static <C extends Collection<T>,T> |
partition(T[] values,
Predicate<T> partitioner,
Provider<C> collectionsProvider)
Partitions elements from the array into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
static <CA extends Collection<T>,CR extends Collection<T>,T> |
partition(T[] values,
Predicate<T> partitioner,
Provider<CA> acceptedCollectionProvider,
Provider<CR> refusedCollectionProvider)
Partitions elements from the array into two collections containing
elements that match the predicate (left side collection) and elements
that don't (right side collection).
|
public static <K,V> Map<K,List<V>> groupBy(Iterator<V> groupies, Delegate<K,V> grouper)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}K - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementspublic static <C extends Collection<V>,K,V> Map<K,C> groupBy(Iterator<V> groupies, Delegate<K,V> grouper, Provider<C> collectionProvider)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}C - the collection type used as value of the mapK - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementscollectionProvider - the values collection providerpublic static <M extends Map<K,C>,C extends Collection<V>,K,V> Map<K,C> groupBy(Iterator<V> groupies, Delegate<K,V> grouper, Provider<C> collectionProvider, Provider<M> mapProvider)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}M - the result map typeC - the collection type used as value of the mapK - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementscollectionProvider - the values collection providermapProvider - the map collection providerpublic static <K,V> Map<K,List<V>> groupBy(Iterable<V> groupies, Delegate<K,V> grouper)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}K - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementspublic static <C extends Collection<V>,K,V> Map<K,C> groupBy(Iterable<V> groupies, Delegate<K,V> grouper, Provider<C> collectionProvider)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}C - the collection type used as value of the mapK - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementscollectionProvider - the values collection providerpublic static <M extends Map<K,C>,C extends Collection<V>,K,V> Map<K,C> groupBy(Iterable<V> groupies, Delegate<K,V> grouper, Provider<C> collectionProvider, Provider<M> mapProvider)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}M - the result map typeC - the collection type used as value of the mapK - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementscollectionProvider - the values collection providermapProvider - the map collection providerpublic static <K,V> Map<K,List<V>> groupBy(V[] groupies, Delegate<K,V> grouper)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}K - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementspublic static <C extends Collection<V>,K,V> Map<K,C> groupBy(V[] groupies, Delegate<K,V> grouper, Provider<C> collectionProvider)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}C - the collection type used as value of the mapK - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementscollectionProvider - the values collection providerpublic static <M extends Map<K,C>,C extends Collection<V>,K,V> Map<K,C> groupBy(V[] groupies, Delegate<K,V> grouper, Provider<C> collectionProvider, Provider<M> mapProvider)
groupBy([1, 2, 3, 1], id) -> { 1: [1,1], 2: [2], 3: [3]}M - the result map typeC - the collection type used as value of the mapK - the grouped key typeV - the grouped value typegroupies - the elements to be groupedgrouper - the delegate used to group elementscollectionProvider - the values collection providermapProvider - the map collection providerpublic static <T> Pair<List<T>,List<T>> partition(Iterator<T> values, Predicate<T> partitioner)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])T - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuespublic static <C extends Collection<T>,T> Pair<C,C> partition(Iterator<T> values, Predicate<T> partitioner, Provider<C> collectionsProvider)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])C - the partitioned elements collection typeT - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuescollectionsProvider - a collection provider used to create both
elements collectionpublic static <CA extends Collection<T>,CR extends Collection<T>,T> Pair<CA,CR> partition(Iterator<T> values, Predicate<T> partitioner, Provider<CA> acceptedCollectionProvider, Provider<CR> refusedCollectionProvider)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])CA - the accepted elements collection typeCR - the refused elements collection typeT - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuesacceptedCollectionProvider - a collection provider used to create
accepted elements collectionrefusedCollectionProvider - a collection provider used to create
refused elements collectionpublic static <T> Pair<List<T>,List<T>> partition(Iterable<T> values, Predicate<T> partitioner)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])T - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuespublic static <C extends Collection<T>,T> Pair<C,C> partition(Iterable<T> values, Predicate<T> partitioner, Provider<C> collectionsProvider)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])C - the partitioned elements collection typeT - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuescollectionsProvider - a collection provider used to create both
elements collectionpublic static <CA extends Collection<T>,CR extends Collection<T>,T> Pair<CA,CR> partition(Iterable<T> values, Predicate<T> partitioner, Provider<CA> acceptedCollectionProvider, Provider<CR> refusedCollectionProvider)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])CA - the accepted elements collection typeCR - the refused elements collection typeT - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuesacceptedCollectionProvider - a collection provider used to create
accepted elements collectionrefusedCollectionProvider - a collection provider used to create
refused elements collectionpublic static <T> Pair<List<T>,List<T>> partition(T[] values, Predicate<T> partitioner)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])T - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuespublic static <C extends Collection<T>,T> Pair<C,C> partition(T[] values, Predicate<T> partitioner, Provider<C> collectionsProvider)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])C - the partitioned elements collection typeT - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuescollectionsProvider - a collection provider used to create both
elements collectionpublic static <CA extends Collection<T>,CR extends Collection<T>,T> Pair<CA,CR> partition(T[] values, Predicate<T> partitioner, Provider<CA> acceptedCollectionProvider, Provider<CR> refusedCollectionProvider)
partition([1,2,3,4], isOdd) -> ([1,3],[2,4])CA - the accepted elements collection typeCR - the refused elements collection typeT - the element typevalues - the values to be partitionedpartitioner - the predicate used to partition valuesacceptedCollectionProvider - a collection provider used to create
accepted elements collectionrefusedCollectionProvider - a collection provider used to create
refused elements collectionpublic static <M extends Map<K,V>,K,V> Map<K,V> indexBy(Iterable<V> groupies, Delegate<K,V> indexer, Provider<M> mapProvider)
indexBy([1,2,3,4], id) -> {1:1, 2:2, 3:3, 4:4}M - the map typeK - the key typeV - the value typegroupies - elements to be indexedindexer - the delegate used to index elementsmapProvider - a provider used to create the resulting mappublic static <K,V> Map<K,V> indexBy(Iterable<V> groupies, Delegate<K,V> indexer)
indexBy([1,2,3,4], id) -> {1:1, 2:2, 3:3, 4:4}K - the key typeV - the value typegroupies - elements to be indexedindexer - the delegate used to index elementspublic static <M extends Map<K,V>,K,V> Map<K,V> indexBy(Iterator<V> groupies, Delegate<K,V> indexer, Provider<M> mapProvider)
indexBy([1,2,3,4], id) -> {1:1, 2:2, 3:3, 4:4}M - the map typeK - the key typeV - the value typegroupies - elements to be indexedindexer - the delegate used to index elementspublic static <K,V> Map<K,V> indexBy(Iterator<V> groupies, Delegate<K,V> indexer)
indexBy([1,2,3,4], id) -> {1:1, 2:2, 3:3, 4:4}K - the key typeV - the value typegroupies - elements to be indexedindexer - the delegate used to index elementspublic static <M extends Map<K,V>,K,V> Map<K,V> indexBy(V[] groupies, Delegate<K,V> indexer, Provider<M> mapProvider)
indexBy([1,2,3,4], id) -> {1:1, 2:2, 3:3, 4:4}M - the map typeK - the key typeV - the value typegroupies - elements to be indexedindexer - the delegate used to index elementsmapProvider - a provider used to create the resulting mappublic static <K,V> Map<K,V> indexBy(V[] groupies, Delegate<K,V> indexer)
indexBy([1,2,3,4], id) -> {1:1, 2:2, 3:3, 4:4}K - the key typeV - the value typegroupies - elements to be indexedindexer - the delegate used to index elementsCopyright © 2013. All rights reserved.