X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fcollections%2FCollectionFilter.java;h=4a1845c2ccea34fca4ede38a4bfadbc252d10c36;hb=96c8961955a306314dfe0cf9ca192252de39fc1c;hp=75cdcb1ec5c4133fbb047ffd9fa4c65f8d3e036b;hpb=f40c213efe9e06805afd66f8569c9cf9acc57184;p=utils diff --git a/support/general/src/main/java/org/wamblee/collections/CollectionFilter.java b/support/general/src/main/java/org/wamblee/collections/CollectionFilter.java index 75cdcb1e..4a1845c2 100644 --- a/support/general/src/main/java/org/wamblee/collections/CollectionFilter.java +++ b/support/general/src/main/java/org/wamblee/collections/CollectionFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2005-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,26 +15,35 @@ */ package org.wamblee.collections; -import java.util.Collection; - import org.wamblee.conditions.Condition; -public class CollectionFilter { +import java.util.Collection; +/** + * + * @author $author$ + * @version $Revision$ + */ +public class CollectionFilter { /** - * Filters a collection by adding all elements in the from collection - * that satisfy a given condition to the to collection. - * @param Type of contained element. - * @param aFrom From container to which the condition is applied. - * @param aTo To container to which matching elements are added. - * @param aCondition Condition by which elements are matched. + * Filters a collection by adding all elements in the from collection that + * satisfy a given condition to the to collection. + * + * @param + * Type of contained element. + * @param aFrom + * From container to which the condition is applied. + * @param aTo + * To container to which matching elements are added. + * @param aCondition + * Condition by which elements are matched. */ - public static void filter(Collection aFrom, Collection aTo, Condition aCondition) { - for (T t: aFrom) { - if ( aCondition.matches(t)) { - aTo.add(t); - } - } - } - + public static void filter(Collection aFrom, Collection aTo, + Condition aCondition) { + for (T t : aFrom) { + if (aCondition.matches(t)) { + aTo.add(t); + } + } + } }