org.powertac.util
Class ListTools

java.lang.Object
  extended by org.powertac.util.ListTools

public class ListTools
extends Object

A collection of static methods intended to simplify list processing tasks. Much of the content is modeled on web resources.

Author:
John Collins

Constructor Summary
ListTools()
           
 
Method Summary
static
<T> List<T>
filter(Collection<T> target, Predicate<T> pred)
          Filters a Collection using a Predicate, returning a List.
static
<T> T
findFirst(Collection<T> target, Predicate<T> pred)
          Returns the first element of a Collection that satisfies a Predicate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListTools

public ListTools()
Method Detail

filter

public static <T> List<T> filter(Collection<T> target,
                                 Predicate<T> pred)
Filters a Collection using a Predicate, returning a List.


findFirst

public static <T> T findFirst(Collection<T> target,
                              Predicate<T> pred)
Returns the first element of a Collection that satisfies a Predicate.



Copyright © 2013. All Rights Reserved.