|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.seas.iis.util.collections.CollectionUtils
public class CollectionUtils
Constructor Summary | |
---|---|
CollectionUtils()
|
Method Summary | ||
---|---|---|
static
|
getCounts(java.util.Collection<K> c)
Takes a collection of objects and returns a Hashtable giving counts for how many times each object appears in the collection |
|
static
|
getMostCommonElements(java.util.Collection<K> c)
Returns the most frequent element in a collection. |
|
static
|
getRandomSubset(java.util.List<T> data,
int subsetSize)
|
|
static
|
intersection(java.util.Collection<T> c1,
java.util.Collection<T> c2)
Returns a vector that contains the intersection of the elements of the two collection passed as input |
|
static
|
union(java.util.Collection<T> c1,
java.util.Collection<T> c2)
Returns a vector that is a sum of the two collection passed as input |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionUtils()
Method Detail |
---|
public static <T> java.util.Vector<T> union(java.util.Collection<T> c1, java.util.Collection<T> c2)
c1
- c2
-
public static <T> java.util.Vector<T> intersection(java.util.Collection<T> c1, java.util.Collection<T> c2)
c1
- c2
-
public static <T> java.util.List<T> getRandomSubset(java.util.List<T> data, int subsetSize)
public static <K> java.util.Hashtable<K,java.lang.Integer> getCounts(java.util.Collection<K> c)
K
- c
-
public static <K> java.lang.Object[] getMostCommonElements(java.util.Collection<K> c)
K
- c
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |