com.ezware.oxbow.swingbits.graphics
Class CollectionUtils

java.lang.Object
  extended by com.ezware.oxbow.swingbits.graphics.CollectionUtils

public class CollectionUtils
extends Object


Constructor Summary
CollectionUtils()
           
 
Method Summary
static boolean isEmpty(Collection<?> c)
          Checks if collection is empty.
static
<T> Collection<T>
trySort(Collection<T> c)
          Tries to sort collection.
 
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

isEmpty

public static final boolean isEmpty(Collection<?> c)
Checks if collection is empty. Null references are considered to be empty collections.

Parameters:
c -
Returns:
true if collection is empty

trySort

public static <T> Collection<T> trySort(Collection<T> c)
Tries to sort collection. All elements have to implement Comparable interface and be mutually comparable

Type Parameters:
T -
Parameters:
any - collection
Returns:
new sorted collection if succeeded otherwise same collection


Copyright © 2011. All Rights Reserved.