org.carrot2.util
Class CollectionUtils

java.lang.Object
  extended by org.carrot2.util.CollectionUtils

public final class CollectionUtils
extends Object

A number of utility classes for working with Collections.


Method Summary
static
<T> T
getFirst(Collection<T> collection)
          Returns the first element from the provided collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFirst

public static <T> T getFirst(Collection<T> collection)
Returns the first element from the provided collection.

Parameters:
collection - the collection to get the element from
Returns:
first element from the provided collection or null if the collection is null or empty.


Copyright (c) Dawid Weiss, Stanislaw Osinski