From dev-return-124406-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Thu Mar 03 00:20:21 2011 Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 36043 invoked from network); 3 Mar 2011 00:20:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Mar 2011 00:20:06 -0000 Received: (qmail 15643 invoked by uid 500); 3 Mar 2011 00:20:05 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 15565 invoked by uid 500); 3 Mar 2011 00:20:05 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 15557 invoked by uid 99); 3 Mar 2011 00:20:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 00:20:05 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.216.43 as permitted sender) Received: from [209.85.216.43] (HELO mail-qw0-f43.google.com) (209.85.216.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 00:19:59 +0000 Received: by qwb7 with SMTP id 7so552569qwb.30 for ; Wed, 02 Mar 2011 16:19:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=nh6xN2MBmxMS6RNPJ+2fUcxQSRCR8SzzMu/Du08LR3k=; b=QR2hQMTgt5Obd20KcDb0WVN5zFNtYV1Jv+IN9cxnbKn4O4BS5Y1DZa5nSb4LITmRmw Qb45wUFlkTpmONXOKeySx6zKgSTfAA+SgZADLEZJ8WW3xd1ZTFp+ZcIcq05v0h4yFrex h8rUa9TgG4aTNnj3I+hzfFOckQ+mPYsIOmmGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Eobj/ysqI2RuUq4Xj1nw9E3H9hcV/sSLfZz+l5tTGIO6K3+dVeDBt+K+9bxRNPw+mV E6fp1Ir1vmYeQ+aThjd9OukP6QKhUOOMrB5fGPb+T//THEqEY0Iq71KUrV1pmss9CeI/ mkshs4SGN1ijZBvcH+lM63GSxX6b2Y3LE8NNs= MIME-Version: 1.0 Received: by 10.229.253.204 with SMTP id nb12mr389319qcb.277.1299111579028; Wed, 02 Mar 2011 16:19:39 -0800 (PST) Received: by 10.229.98.129 with HTTP; Wed, 2 Mar 2011 16:19:38 -0800 (PST) In-Reply-To: <20110302225502.90CE52388A70@eris.apache.org> References: <20110302225502.90CE52388A70@eris.apache.org> Date: Thu, 3 Mar 2011 00:19:38 +0000 Message-ID: Subject: Re: svn commit: r1076446 - in /commons/sandbox/functor/trunk/src: main/java/org/apache/commons/functor/core/collection/FilteredIterable.java test/java/org/apache/commons/functor/core/collection/TestFilteredIterable.java From: sebb To: dev@commons.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2 March 2011 22:55, wrote: > Author: mbenson > Date: Wed Mar =A02 22:55:02 2011 > New Revision: 1076446 > > URL: http://svn.apache.org/viewvc?rev=3D1076446&view=3Drev > Log: > add FilteredIterable > > Added: > =A0 =A0commons/sandbox/functor/trunk/src/main/java/org/apache/commons/fun= ctor/core/collection/FilteredIterable.java =A0 (with props) > =A0 =A0commons/sandbox/functor/trunk/src/test/java/org/apache/commons/fun= ctor/core/collection/TestFilteredIterable.java =A0 (with props) > > Added: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/fun= ctor/core/collection/FilteredIterable.java > URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/= java/org/apache/commons/functor/core/collection/FilteredIterable.java?rev= =3D1076446&view=3Dauto > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functo= r/core/collection/FilteredIterable.java (added) > +++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functo= r/core/collection/FilteredIterable.java Wed Mar =A02 22:55:02 2011 > @@ -0,0 +1,172 @@ > +/* > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. =A0See the NOTICE file distributed wi= th > + * this work for additional information regarding copyright ownership. > + * The ASF licenses this file to You under the Apache License, Version 2= .0 > + * (the "License"); you may not use this file except in compliance with > + * the License. =A0You may obtain a copy of the License at > + * > + * =A0 =A0 =A0http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impli= ed. > + * See the License for the specific language governing permissions and > + * limitations under the License. > + */ > +package org.apache.commons.functor.core.collection; > + > +import java.util.Collections; > +import java.util.Iterator; > + > +import org.apache.commons.functor.UnaryFunction; > +import org.apache.commons.functor.UnaryPredicate; > +import org.apache.commons.functor.core.IsInstance; > +import org.apache.commons.functor.core.composite.UnaryAnd; > + > +/** > + * Adds a fluent filtering API to any {@link Iterable}. > + * > + * @version $Revision$ $Date$ > + * > + * @param > + */ > +public class FilteredIterable implements Iterable { > + =A0 =A0@SuppressWarnings({ "rawtypes", "unchecked" }) > + =A0 =A0// type irrelevant for empty instance > + =A0 =A0private static final FilteredIterable EMPTY =3D new FilteredIter= able(Collections.EMPTY_LIST) { BTW, using Collections.emptyList() instead should allow the @Suppress tag to be removed. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org