You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stephen Colebourne <sc...@eurobell.co.uk> on 2002/05/02 00:38:00 UTC

[Collections][SUBMIT] PredicateUtils [was TypedList]

Hi all,
Please find attached PredicateUtils.

PredicateUtils is a single class that provides predicate (validating)
implementations of all java and commons collections:
Collection
List
Set, SortedSet
Map, SortedMap
Bag, SortedBag

It also provides useful predicate classes:
True
False
And
Or
Not
instanceof

To avoid polluting the commons package with the 18 classes necessary to
achieve this, they are all implemented as static nested classes within
PredicateUtils. This is similar to how synchronized and unmodifiable
collections work in java.util.Collections. All the classes are created and
used by static factory methods, except True and False which are constants.

Feedback welcome on the implementation, and indications of acceptability for
actual inclusion in commons.

Stephen

Re: [Collections][SUBMIT] PredicateUtils [was TypedList]

Posted by Stephen Colebourne <sc...@eurobell.co.uk>.
Hi,
Thanks for the cvs add.
Please find attached some basic unit tests for List, Set and Map.
Stephen
----- Original Message -----
From: James Strachan <ja...@yahoo.co.uk>
To: Jakarta Commons Developers List <co...@jakarta.apache.org>
Sent: Thursday, May 02, 2002 7:17 AM
Subject: Re: [Collections][SUBMIT] PredicateUtils [was TypedList]


> Hi Stephen
>
> I've given the code a quick once-over and it looks great. Nice and clean.
> I've added into CVS - if anyone has any objections please speak up.
>
> Some JUnit test cases would be nice for this stuff ;-)
>
> James
> ----- Original Message -----
> From: "Stephen Colebourne" <sc...@eurobell.co.uk>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Wednesday, May 01, 2002 11:38 PM
> Subject: [Collections][SUBMIT] PredicateUtils [was TypedList]
>
>
> > Hi all,
> > Please find attached PredicateUtils.
> >
> > PredicateUtils is a single class that provides predicate (validating)
> > implementations of all java and commons collections:
> > Collection
> > List
> > Set, SortedSet
> > Map, SortedMap
> > Bag, SortedBag
> >
> > It also provides useful predicate classes:
> > True
> > False
> > And
> > Or
> > Not
> > instanceof
> >
> > To avoid polluting the commons package with the 18 classes necessary to
> > achieve this, they are all implemented as static nested classes within
> > PredicateUtils. This is similar to how synchronized and unmodifiable
> > collections work in java.util.Collections. All the classes are created
and
> > used by static factory methods, except True and False which are
constants.
> >
> > Feedback welcome on the implementation, and indications of acceptability
> for
> > actual inclusion in commons.
> >
> > Stephen
> >
>
>
> --------------------------------------------------------------------------
--
> ----
>
>
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

Re: [Collections][SUBMIT] PredicateUtils [was TypedList]

Posted by James Strachan <ja...@yahoo.co.uk>.
Hi Stephen

I've given the code a quick once-over and it looks great. Nice and clean.
I've added into CVS - if anyone has any objections please speak up.

Some JUnit test cases would be nice for this stuff ;-)

James
----- Original Message -----
From: "Stephen Colebourne" <sc...@eurobell.co.uk>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Wednesday, May 01, 2002 11:38 PM
Subject: [Collections][SUBMIT] PredicateUtils [was TypedList]


> Hi all,
> Please find attached PredicateUtils.
>
> PredicateUtils is a single class that provides predicate (validating)
> implementations of all java and commons collections:
> Collection
> List
> Set, SortedSet
> Map, SortedMap
> Bag, SortedBag
>
> It also provides useful predicate classes:
> True
> False
> And
> Or
> Not
> instanceof
>
> To avoid polluting the commons package with the 18 classes necessary to
> achieve this, they are all implemented as static nested classes within
> PredicateUtils. This is similar to how synchronized and unmodifiable
> collections work in java.util.Collections. All the classes are created and
> used by static factory methods, except True and False which are constants.
>
> Feedback welcome on the implementation, and indications of acceptability
for
> actual inclusion in commons.
>
> Stephen
>


----------------------------------------------------------------------------
----


> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>