de.mindcrimeilab.util
Class CollectionsHelper
java.lang.Object
de.mindcrimeilab.util.CollectionsHelper
public class CollectionsHelper
- extends Object
- Version:
- $Revision:62 $
- Author:
- Michael Engelhardt, $Author:me $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionsHelper
public CollectionsHelper()
filterCollection
public static <T> void filterCollection(Collection<T> collection,
Filter<? super T> filter)
- Removes all elements from the collection for which the given
Filter
returns true.
- Type Parameters:
T
- type specification of collection contents- Parameters:
collection
- collection to be filteredfilter
- instance of filter which will be evaluated for each element in the collection
reduceCollection
public static <T> void reduceCollection(Collection<T> collection)
- Removes all duplicate items from given collection
- Type Parameters:
T
- type of items in collection- Parameters:
collection
-
copyCollection
public static <TIN,TOUT> void copyCollection(Collection<TIN> source,
Collection<TOUT> dest,
Converter<TIN,TOUT> converter)
- Copies all items from the source collection to given collection using specified converter class.
- Type Parameters:
TIN
- type of items in source collectionTOUT
- type of items in destination collection- Parameters:
source
- source collectiondest
- destination collectionconverter
- function to convert one object into the other one
Copyright © 2010. All Rights Reserved.