commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: [collections] IfClosure
Date Fri, 03 Feb 2006 04:32:31 GMT
--- Stephen Colebourne <scolebourne@btopenworld.com>
wrote:

> The IfClosure is meant to represent an if statement
> in code, so it 
> should support what is effectively an if without an
> else.

Glad you agree!  ;)

> 
> If you do this, it should include the associated
> static method on 
> IfClosure and ClosureUtils.
> 

I went ahead and did all of the above earlier for fun.
 I'll submit the patch tomorrow.  Don't forget a
couple of cursory tests too.

Thanks,
Matt

> Stephen
> 
> 
> Matt Benson wrote:
> > Is there any interest in adding:
> > 
> > public IfClosure(Predicate predicate, Closure
> > trueClosure) {
> >     this(predicate, trueClosure,
> NOPClosure.INSTANCE);
> > }
> > 
> > public static Closure getInstance(Predicate
> predicate,
> > Closure trueClosure) {
> >     return getInstance(predicate, trueClosure,
> > NOPClosure.INSTANCE);
> > }
> > 
> > + ClosureUtils.ifClosure(Predicate, Closure
> > trueClosure);
> > 
> > ?
> > 
> > This is for convenience only... (and saving on
> > Collection instances).  If this would be accepted
> I
> > will submit a patch.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message