org.aksw.commons.collections
Class CollectionUtils
java.lang.Object
org.aksw.commons.collections.CollectionUtils
public class CollectionUtils
- extends Object
User: raven
Date: 4/17/11
Time: 12:36 AM
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionUtils
public CollectionUtils()
safeGetFirst
public static <S,T extends Iterable<S>> Iterable<S> safeGetFirst(Iterable<T> iterable)
- Given an iterable A whose elements are iterables, this method will return the first
element of A.
If no such element exist, an empty iterable is returned rather than null.
- Type Parameters:
S - T - - Parameters:
iterable -
- Returns:
chunk
public static <T> List<List<T>> chunk(Iterable<T> col,
int batchSize)
asSet
public static <T> Set<T> asSet(Collection<T> c)
Copyright © 2012. All Rights Reserved.