|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.ihmc.utilities.containers.ContainerTools
public class ContainerTools
Class contains static functions that are useful when dealing with container classes such as ArrayList, EnumMap, HashMap, etc.
Method Summary | ||
---|---|---|
static
|
asSortedList(java.util.Collection<T> c)
|
|
static
|
createEnumMap(java.lang.Class<K> keyType)
Creates a new EnumMap. |
|
static
|
findLargestElements(java.util.Collection<? extends E> collection,
java.util.Comparator<? super E> comparator,
int n)
Finds the n largest elements of the given collection, according to the specified comparator. |
|
static
|
flatten(java.util.EnumMap<K1,java.util.EnumMap<K2,V>> mapOfMaps)
Takes all the elements in an EnumMap of EnumMaps and puts them in an ArrayList |
|
static
|
removeByReference(java.util.List<T> list,
T o)
Removes an object from a list *by reference*, instead of using the equals method |
|
static
|
toArrayOfArrays(java.util.EnumMap<K1,java.util.EnumMap<K2,java.lang.Double>> mapOfMaps)
Takes all the elements in an EnumMap of EnumMaps and puts them into an array of arrays |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <K extends java.lang.Enum<K>,V> java.util.EnumMap<K,V> createEnumMap(java.lang.Class<K> keyType)
K
- key typeV
- value typekeyType
- runtime key type
public static <E> java.util.TreeSet<E> findLargestElements(java.util.Collection<? extends E> collection, java.util.Comparator<? super E> comparator, int n)
E
- collection typecollection
- the collection from which the largest elements need to be foundcomparator
- compares the elements of the collection.n
- maximum number of elements contained in the returned set
public static <K1 extends java.lang.Enum<K1>,K2 extends java.lang.Enum<K2>,V> java.util.ArrayList<V> flatten(java.util.EnumMap<K1,java.util.EnumMap<K2,V>> mapOfMaps)
public static <K1 extends java.lang.Enum<K1>,K2 extends java.lang.Enum<K2>> double[][] toArrayOfArrays(java.util.EnumMap<K1,java.util.EnumMap<K2,java.lang.Double>> mapOfMaps)
public static <T extends java.lang.Comparable<? super T>> java.util.List<T> asSortedList(java.util.Collection<T> c)
public static <T> boolean removeByReference(java.util.List<T> list, T o)
list
- o
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |