## net.dontdrinkandroot.utils.collections
Class CollectionUtils

    java.lang.Object
      org.apache.commons.collections15.CollectionUtils
          net.dontdrinkandroot.utils.collections.CollectionUtils

    public class CollectionUtils

extends org.apache.commons.collections15.CollectionUtils

Field Summary

Fields inherited from class org.apache.commons.collections15.CollectionUtils
`EMPTY_COLLECTION`

Constructor Summary
`CollectionUtils()`

Method Summary

`static

`<K,V> void`

`

`addToMapList(K key, V value, java.util.Map<K,java.util.List<V>> map)`

`static

`<K,V> void`

`

`addToMapSet(K key, V value, java.util.Map<K,java.util.Set<V>> map)`

`static

`<T extends java.lang.Number> AggregationResult`

`

`aggregate(java.util.Collection<T> collection)`

`static

`<K,V extends java.lang.Comparable<? super V>> java.util.SortedSet<java.util.Map.Entry<K,V>>`

`

`entriesSortedByValues(java.util.Map<K,V> map)`

`static

`<K,V extends java.lang.Comparable<? super V>> java.util.SortedSet<java.util.Map.Entry<K,V>>`

`

`entriesSortedByValuesInverse(java.util.Map<K,V> map)`

`static

`<T> T`

`

`first(java.lang.Iterable<T> iterable)`

`static

`<T extends java.lang.Number> double`

`

`getMean(java.util.Collection<T> collection)`

`static

`<V> V`

`

`getRandom(java.util.Collection<V> collection)`

`static boolean` `isEmpty(java.lang.Object obj)` Nullsafe check if a collection is empty.

Methods inherited from class org.apache.commons.collections15.CollectionUtils

`addAll, addAll, addAll, cardinality, collect, collect, collect, collect, containsAny, countMatches, disjunction, exists, filter, find, forAllDo, get, getCardinalityMap, index, index, intersection, isEqualCollection, isFull, isProperSubCollection, isSubCollection, main, maxSize, predicatedCollection, reverseArray, select, select, selectRejected, selectRejected, size, subtract, synchronizedCollection, transform, transformedCollection, typedCollection, union, unmodifiableCollection`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CollectionUtils

    public CollectionUtils()

Method Detail

### aggregate

    public static <T extends java.lang.Number> AggregationResult aggregate(java.util.Collection<T> collection)

### getMean

    public static <T extends java.lang.Number> double getMean(java.util.Collection<T> collection)

### first

    public static <T> T first(java.lang.Iterable<T> iterable)

### isEmpty

    public static boolean isEmpty(java.lang.Object obj)

  Nullsafe check if a collection is empty.

  Parameters:
    `obj` - Null or a subclass of Collection.
  Throws:
    `java.lang.IllegalArgumentException` - Thrown if obj is not null and not an instance of Collection.

### addToMapList

    public static <K,V> void addToMapList(K key,
                                          V value,
                                          java.util.Map<K,java.util.List<V>> map)

### addToMapSet

    public static <K,V> void addToMapSet(K key,
                                         V value,
                                         java.util.Map<K,java.util.Set<V>> map)

### getRandom

    public static <V> V getRandom(java.util.Collection<V> collection)

### entriesSortedByValues

    public static <K,V extends java.lang.Comparable<? super V>> java.util.SortedSet<java.util.Map.Entry<K,V>> entriesSortedByValues(java.util.Map<K,V> map)

### entriesSortedByValuesInverse

    public static <K,V extends java.lang.Comparable<? super V>> java.util.SortedSet<java.util.Map.Entry<K,V>> entriesSortedByValuesInverse(java.util.Map<K,V> map)

Copyright © 2013 dontdrinkandroot. All Rights Reserved.