commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r656304 - /commons/sandbox/functor/branches/mjbRadicalExperimentation/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
Date Wed, 14 May 2008 14:50:39 GMT
Author: mbenson
Date: Wed May 14 07:50:39 2008
New Revision: 656304

URL: http://svn.apache.org/viewvc?rev=656304&view=rev
Log:
add alt constructor

Modified:
    commons/sandbox/functor/branches/mjbRadicalExperimentation/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java

Modified: commons/sandbox/functor/branches/mjbRadicalExperimentation/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/branches/mjbRadicalExperimentation/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java?rev=656304&r1=656303&r2=656304&view=diff
==============================================================================
--- commons/sandbox/functor/branches/mjbRadicalExperimentation/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
(original)
+++ commons/sandbox/functor/branches/mjbRadicalExperimentation/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
Wed May 14 07:50:39 2008
@@ -20,6 +20,7 @@
 
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.BinaryProcedure;
+import org.apache.commons.functor.core.NoOp;
 
 /**
  * A {@link BinaryProcedure BinaryProcedure}
@@ -54,13 +55,22 @@
     /**
      * Create a new ConditionalBinaryProcedure.
      * @param ifPred to evaluate
-     * @param thenPred if <code>ifPred</code> yields <code>true</code>
-     * @param elsePred if <code>ifPred</code> yields <code>false</code>
+     * @param thenProc if <code>ifPred</code> yields <code>true</code>
      */
-    public ConditionalBinaryProcedure(BinaryPredicate ifPred, BinaryProcedure thenPred, BinaryProcedure
elsePred) {
+    public ConditionalBinaryProcedure(BinaryPredicate ifPred, BinaryProcedure thenProc) {
+        this(ifPred, thenProc, NoOp.instance());
+    }
+    
+    /**
+     * Create a new ConditionalBinaryProcedure.
+     * @param ifPred to evaluate
+     * @param thenProc if <code>ifPred</code> yields <code>true</code>
+     * @param elseProc if <code>ifPred</code> yields <code>false</code>
+     */
+    public ConditionalBinaryProcedure(BinaryPredicate ifPred, BinaryProcedure thenProc, BinaryProcedure
elseProc) {
         this.ifPred = ifPred;
-        this.thenProc = thenPred;
-        this.elseProc = elsePred;
+        this.thenProc = thenProc;
+        this.elseProc = elseProc;
     }
 
     // predicate interface



Mime
View raw message