commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <scolebou...@btopenworld.com>
Subject Re: [collections] IfClosure
Date Thu, 02 Feb 2006 23:21:48 GMT
The IfClosure is meant to represent an if statement in code, so it 
should support what is effectively an if without an else.

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

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


Mime
View raw message