public class CollectionHelper extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
CollectionHelper.Partitioner<K,V> |
Modifier and Type | Method and Description |
---|---|
static <T> Set<T> |
asSet(T... ts) |
static <T> ArrayList<T> |
newArrayList() |
static <T> ArrayList<T> |
newArrayList(int size) |
static <T> ArrayList<T> |
newArrayList(Iterable<T>... iterables) |
static <K,V> HashMap<K,V> |
newHashMap() |
static <K,V> HashMap<K,V> |
newHashMap(int size) |
static <T> HashSet<T> |
newHashSet() |
static <T> HashSet<T> |
newHashSet(int size) |
static <K,V> Map<K,List<V>> |
partition(List<V> list,
CollectionHelper.Partitioner<K,V> partitioner)
Creates a map containing the given list's values partitioned by the given
partitioner.
|
public static <K,V> HashMap<K,V> newHashMap()
public static <K,V> HashMap<K,V> newHashMap(int size)
public static <T> HashSet<T> newHashSet()
public static <T> HashSet<T> newHashSet(int size)
public static <T> ArrayList<T> newArrayList()
public static <T> ArrayList<T> newArrayList(int size)
public static <T> Set<T> asSet(T... ts)
public static <K,V> Map<K,List<V>> partition(List<V> list, CollectionHelper.Partitioner<K,V> partitioner)
K
- The key type of the resulting map.V
- The element type of the list to be partitioned.list
- The list to be partitioned.partitioner
- The partitioner to be used for determining the partitions.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.