org.marketcetera.util.misc
Class CollectionUtils

java.lang.Object
  extended by org.marketcetera.util.misc.CollectionUtils

public final class CollectionUtils
extends Object

Utilities for collections.

Since:
0.6.0
Version:
$Id: CollectionUtils.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Method Summary
static
<E> E
getLastNonNull(List<E> l)
          Returns the last non-null element in the given list; or, if there is no non-null element, it returns null.
static int[] toArray(List<Integer> l)
          Returns the non-null integers in the given list as an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLastNonNull

public static <E> E getLastNonNull(List<E> l)
Returns the last non-null element in the given list; or, if there is no non-null element, it returns null.

Parameters:
l - The list. It may be null, in which case null is returned.
Returns:
The element.

toArray

public static int[] toArray(List<Integer> l)
Returns the non-null integers in the given list as an array.

Parameters:
l - The list. It may be null, in which case null is returned.
Returns:
The array.


Copyright © 2012. All Rights Reserved.