commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r644988 [1/2] - in /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor: adapter/ core/ core/collection/ core/comparator/ core/composite/ generator/util/
Date Fri, 04 Apr 2008 23:08:27 GMT
Author: mbenson
Date: Fri Apr  4 16:08:18 2008
New Revision: 644988

URL: http://svn.apache.org/viewvc?rev=644988&view=rev
Log:
checkstyle

Modified:
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Identity.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Conditional.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/DoWhileProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Sequence.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/EachElement.java

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryProcedure.java Fri Apr  4 16:08:18 2008
@@ -39,23 +39,6 @@
  */
 public final class BinaryFunctionBinaryProcedure implements BinaryProcedure, Serializable {
 
-    /**
-     * Adapt the given, possibly-<code>null</code>,
-     * {@link BinaryFunction BinaryFunction} to the
-     * {@link BinaryProcedure BinaryProcedure} interface.
-     * When the given <code>BinaryFunction</code> is <code>null</code>,
-     * returns <code>null</code>.
-     *
-     * @param function the possibly-<code>null</code>
-     *        {@link BinaryFunction BinaryFunction} to adapt
-     * @return a <code>BinaryFunctionBinaryProcedure</code> wrapping the given
-     *         {@link BinaryFunction BinaryFunction}, or <code>null</code>
-     *         if the given <code>BinaryFunction</code> is <code>null</code>
-     */
-    public static BinaryFunctionBinaryProcedure adapt(BinaryFunction function) {
-        return null == function ? null : new BinaryFunctionBinaryProcedure(function);
-    }
-
     /** The {@link BinaryFunction BinaryFunction} I'm wrapping. */
     private BinaryFunction function = null;
 
@@ -71,6 +54,7 @@
     /**
      * {@link BinaryFunction#evaluate Evaluate} my function, but
      * ignore its returned value.
+     * {@inheritDoc}
      */
     public void run(Object left, Object right) {
         function.evaluate(left, right);
@@ -113,6 +97,23 @@
      */
     public String toString() {
         return "BinaryFunctionBinaryProcedure<" + function + ">";
+    }
+
+    /**
+     * Adapt the given, possibly-<code>null</code>,
+     * {@link BinaryFunction BinaryFunction} to the
+     * {@link BinaryProcedure BinaryProcedure} interface.
+     * When the given <code>BinaryFunction</code> is <code>null</code>,
+     * returns <code>null</code>.
+     *
+     * @param function the possibly-<code>null</code>
+     *        {@link BinaryFunction BinaryFunction} to adapt
+     * @return a <code>BinaryFunctionBinaryProcedure</code> wrapping the given
+     *         {@link BinaryFunction BinaryFunction}, or <code>null</code>
+     *         if the given <code>BinaryFunction</code> is <code>null</code>
+     */
+    public static BinaryFunctionBinaryProcedure adapt(BinaryFunction function) {
+        return null == function ? null : new BinaryFunctionBinaryProcedure(function);
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryProcedureBinaryFunction.java Fri Apr  4 16:08:18 2008
@@ -39,19 +39,28 @@
  * @author Rodney Waldhoff
  */
 public final class BinaryProcedureBinaryFunction implements BinaryFunction, Serializable {
-    
     /** The {@link BinaryProcedure BinaryProcedure} I'm wrapping. */
     private BinaryProcedure procedure = null;
 
+    /**
+     * Create a new BinaryProcedureBinaryFunction.
+     * @param procedure to adapt as a BinaryFunction
+     */
     public BinaryProcedureBinaryFunction(BinaryProcedure procedure) {
         this.procedure = procedure;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object left, Object right) {
         procedure.run(left, right);
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof BinaryProcedureBinaryFunction) {
             return equals((BinaryProcedureBinaryFunction) that);
@@ -60,11 +69,19 @@
         }
     }
 
+    /**
+     * Learn whether another BinaryProcedureBinaryFunction is equal to this.
+     * @param that the BinaryProcedureBinaryFunction to test
+     * @return boolean
+     */
     public boolean equals(BinaryProcedureBinaryFunction that) {
         return that == this
                 || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "BinaryProcedureBinaryFunction".hashCode();
         if (null != procedure) {
@@ -73,6 +90,9 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "BinaryProcedureBinaryFunction<" + procedure + ">";
     }
@@ -93,4 +113,5 @@
     public static BinaryProcedureBinaryFunction adapt(BinaryProcedure procedure) {
         return null == procedure ? null : new BinaryProcedureBinaryFunction(procedure);
     }
+
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundProcedure.java Fri Apr  4 16:08:18 2008
@@ -39,26 +39,6 @@
  * @author Rodney Waldhoff
  */
 public final class BoundProcedure implements Procedure, Serializable {
-    /**
-     * Adapt the given, possibly-<code>null</code>,
-     * {@link UnaryProcedure UnaryProcedure} to the
-     * {@link Procedure Procedure} interface by binding
-     * the specified <code>Object</code> as a constant
-     * argument.
-     * When the given <code>UnaryProcedure</code> is <code>null</code>,
-     * returns <code>null</code>.
-     *
-     * @param procedure the possibly-<code>null</code>
-     *        {@link UnaryProcedure UnaryProcedure} to adapt
-     * @param arg the object to bind as a constant argument
-     * @return a <code>BoundProcedure</code> wrapping the given
-     *         {@link UnaryProcedure UnaryProcedure}, or <code>null</code>
-     *         if the given <code>UnaryProcedure</code> is <code>null</code>
-     */
-    public static BoundProcedure bind(UnaryProcedure procedure, Object arg) {
-        return null == procedure ? null : new BoundProcedure(procedure,arg);
-    }
-
     /** The {@link UnaryProcedure UnaryProcedure} I'm wrapping. */
     private UnaryProcedure procedure = null;
     /** The parameter to pass to that procedure. */
@@ -124,6 +104,26 @@
      */
     public String toString() {
         return "BoundProcedure<" + procedure + "(" + param + ")>";
+    }
+
+    /**
+     * Adapt the given, possibly-<code>null</code>,
+     * {@link UnaryProcedure UnaryProcedure} to the
+     * {@link Procedure Procedure} interface by binding
+     * the specified <code>Object</code> as a constant
+     * argument.
+     * When the given <code>UnaryProcedure</code> is <code>null</code>,
+     * returns <code>null</code>.
+     *
+     * @param procedure the possibly-<code>null</code>
+     *        {@link UnaryProcedure UnaryProcedure} to adapt
+     * @param arg the object to bind as a constant argument
+     * @return a <code>BoundProcedure</code> wrapping the given
+     *         {@link UnaryProcedure UnaryProcedure}, or <code>null</code>
+     *         if the given <code>UnaryProcedure</code> is <code>null</code>
+     */
+    public static BoundProcedure bind(UnaryProcedure procedure, Object arg) {
+        return null == procedure ? null : new BoundProcedure(procedure, arg);
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionPredicate.java Fri Apr  4 16:08:18 2008
@@ -37,6 +37,14 @@
  * @author Rodney Waldhoff
  */
 public final class FunctionPredicate implements Predicate, Serializable {
+
+    /** The {@link Function Function} I'm wrapping. */
+    private Function function = null;
+
+    /**
+     * Create a new FunctionPredicate.
+     * @param function to adapt
+     */
     public FunctionPredicate(Function function) {
         this.function = function;
     }
@@ -45,14 +53,17 @@
      * Returns the <code>boolean</code> value of the non-<code>null</code>
      * <code>Boolean</code> returned by the {@link Function#evaluate evaluate}
      * method of my underlying function.
-     *
+     * {@inheritDoc}
      * @throws NullPointerException if my underlying function returns <code>null</code>
      * @throws ClassCastException if my underlying function returns a non-<code>Boolean</code>
      */
     public boolean test() {
-        return ((Boolean)(function.evaluate())).booleanValue();
+        return ((Boolean) (function.evaluate())).booleanValue();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof FunctionPredicate) {
             return equals((FunctionPredicate) that);
@@ -61,10 +72,19 @@
         }
     }
 
+    /**
+     * Learn whether another FunctionPredicate is equal to this.
+     * @param that FunctionPredicate to test
+     * @return boolean
+     */
     public boolean equals(FunctionPredicate that) {
-        return that == this || (null != that && (null == function ? null == that.function : function.equals(that.function)));
+        return that == this
+                || (null != that && (null == function ? null == that.function : function.equals(that.function)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "FunctionPredicate".hashCode();
         if (null != function) {
@@ -73,14 +93,19 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "FunctionPredicate<" + function + ">";
     }
 
+    /**
+     * Adapt a Function as a Predicate.
+     * @param function to adapt
+     * @return FunctionPredicate
+     */
     public static FunctionPredicate adapt(Function function) {
         return null == function ? null : new FunctionPredicate(function);
     }
-
-    /** The {@link Function Function} I'm wrapping. */
-    private Function function = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftPredicate.java Fri Apr  4 16:08:18 2008
@@ -39,21 +39,27 @@
  * @author Rodney Waldhoff
  */
 public final class IgnoreLeftPredicate implements BinaryPredicate, Serializable {
-    public static IgnoreLeftPredicate adapt(UnaryPredicate predicate) {
-        return null == predicate ? null : new IgnoreLeftPredicate(predicate);
-    }
-
     /** The {@link UnaryPredicate UnaryPredicate} I'm wrapping. */
     private UnaryPredicate predicate = null;
 
+    /**
+     * Create a new IgnoreLeftPredicate.
+     * @param predicate the right predicate
+     */
     public IgnoreLeftPredicate(UnaryPredicate predicate) {
         this.predicate = predicate;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object left, Object right) {
         return predicate.test(right);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof IgnoreLeftPredicate) {
             return equals((IgnoreLeftPredicate) that);
@@ -62,11 +68,19 @@
         }
     }
 
+    /**
+     * Learn whether another IgnoreLeftPredicate is equal to this.
+     * @param that the IgnoreLeftPredicate to test
+     * @return boolean
+     */
     public boolean equals(IgnoreLeftPredicate that) {
         return that == this
                 || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "IgnoreLeftPredicate".hashCode();
         if (null != predicate) {
@@ -75,8 +89,21 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "IgnoreLeftPredicate<" + predicate + ">";
     }
 
+    /**
+     * Adapt a UnaryPredicate to an IgnoreLeftPredicate.
+     * @param predicate to adapt
+     * @return IgnoreLeftPredicate
+     */
+    public static IgnoreLeftPredicate adapt(UnaryPredicate predicate) {
+        return null == predicate ? null : new IgnoreLeftPredicate(predicate);
+    }
+
+    //TODO add static adapt(UnaryPredicate) method
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightPredicate.java Fri Apr  4 16:08:18 2008
@@ -39,20 +39,12 @@
  * @author Rodney Waldhoff
  */
 public final class IgnoreRightPredicate implements BinaryPredicate, Serializable {
-    /**
-     * @param predicate
-     * @return
-     */
-    public static IgnoreRightPredicate adapt(UnaryPredicate predicate) {
-        return null == predicate ? null : new IgnoreRightPredicate(predicate);
-    }
-
     /** The {@link UnaryPredicate UnaryPredicate} I'm wrapping. */
     private UnaryPredicate predicate = null;
 
     /**
      * Create a new IgnoreRightPredicate.
-     * @param predicate
+     * @param predicate left
      */
     public IgnoreRightPredicate(UnaryPredicate predicate) {
         this.predicate = predicate;
@@ -102,6 +94,15 @@
      */
     public String toString() {
         return "IgnoreRightPredicate<" + predicate + ">";
+    }
+
+    /**
+     * Adapt a UnaryPredicate as an IgnoreRightPredicate
+     * @param predicate to adapt
+     * @return IgnoreRightPredicate
+     */
+    public static IgnoreRightPredicate adapt(UnaryPredicate predicate) {
+        return null == predicate ? null : new IgnoreRightPredicate(predicate);
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundFunction.java Fri Apr  4 16:08:18 2008
@@ -39,7 +39,13 @@
  * @author Rodney Waldhoff
  */
 public final class LeftBoundFunction implements UnaryFunction, Serializable {
+    /** The {@link BinaryFunction BinaryFunction} I'm wrapping. */
+    private BinaryFunction function = null;
+    /** The parameter to pass to that function. */
+    private Object param = null;
+
     /**
+     * Create a new LeftBoundFunction.
      * @param function the function to adapt
      * @param arg the constant argument to use
      */
@@ -48,10 +54,16 @@
         this.param = arg;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object obj) {
-        return function.evaluate(param,obj);
+        return function.evaluate(param, obj);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof LeftBoundFunction) {
             return equals((LeftBoundFunction) that);
@@ -60,14 +72,20 @@
         }
     }
 
+    /**
+     * Learn whether another LeftBoundFunction is equal to this.
+     * @param that LeftBoundFunction to test
+     * @return boolean
+     */
     public boolean equals(LeftBoundFunction that) {
-        return that == this || (
-                (null != that) &&
-                (null == function ? null == that.function : function.equals(that.function)) &&
-                (null == param ? null == that.param : param.equals(that.param)) );
-
+        return that == this || ((null != that)
+                && (null == function ? null == that.function : function.equals(that.function))
+                && (null == param ? null == that.param : param.equals(that.param)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "LeftBoundFunction".hashCode();
         if (null != function) {
@@ -81,16 +99,21 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "LeftBoundFunction<" + function + "(" + param + ",?)>";
     }
 
+    /**
+     * Adapt a BinaryFunction as a UnaryFunction.
+     * @param function to adapt
+     * @param arg left side argument
+     * @return LeftBoundFunction
+     */
     public static LeftBoundFunction bind(BinaryFunction function, Object arg) {
-        return null == function ? null : new LeftBoundFunction(function,arg);
+        return null == function ? null : new LeftBoundFunction(function, arg);
     }
 
-    /** The {@link BinaryFunction BinaryFunction} I'm wrapping. */
-    private BinaryFunction function = null;
-    /** The parameter to pass to that function. */
-    private Object param = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureFunction.java Fri Apr  4 16:08:18 2008
@@ -39,15 +39,28 @@
  * @author Rodney Waldhoff
  */
 public final class ProcedureFunction implements Function, Serializable {
+    /** The {@link Procedure Procedure} I'm wrapping. */
+    private Procedure procedure = null;
+
+    /**
+     * Create a new ProcedureFunction.
+     * @param procedure to adapt
+     */
     public ProcedureFunction(Procedure procedure) {
         this.procedure = procedure;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate() {
         procedure.run();
         return null;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof ProcedureFunction) {
             return equals((ProcedureFunction) that);
@@ -56,10 +69,19 @@
         }
     }
 
+    /**
+     * Learn whether another ProcedureFunction is equal to this.
+     * @param that ProcedureFunction to test
+     * @return boolean
+     */
     public boolean equals(ProcedureFunction that) {
-        return that == this || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
+        return that == this
+                || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "ProcedureFunction".hashCode();
         if (null != procedure) {
@@ -68,14 +90,20 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "ProcedureFunction<" + procedure + ">";
     }
 
+    /**
+     * Adapt a Procedure as a Function.
+     * @param procedure to adapt
+     * @return ProcedureFunction
+     */
     public static ProcedureFunction adapt(Procedure procedure) {
         return null == procedure ? null : new ProcedureFunction(procedure);
     }
 
-    /** The {@link Procedure Procedure} I'm wrapping. */
-    private Procedure procedure = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundPredicate.java Fri Apr  4 16:08:18 2008
@@ -39,7 +39,13 @@
  * @author Rodney Waldhoff
  */
 public final class RightBoundPredicate implements UnaryPredicate, Serializable {
+    /** The {@link BinaryPredicate BinaryPredicate} I'm wrapping. */
+    private BinaryPredicate predicate = null;
+    /** The parameter to pass to that predicate. */
+    private Object param = null;
+
     /**
+     * Create a new RightBoundPredicate.
      * @param predicate the predicate to adapt
      * @param arg the constant argument to use
      */
@@ -48,10 +54,16 @@
         this.param = arg;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object obj) {
         return predicate.test(obj,param);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof RightBoundPredicate) {
             return equals((RightBoundPredicate) that);
@@ -60,14 +72,20 @@
         }
     }
 
+    /**
+     * Learn whether another RightBoundPredicate is equal to this.
+     * @param that RightBoundPredicate to test
+     * @return boolean
+     */
     public boolean equals(RightBoundPredicate that) {
-        return that == this || (
-                (null != that) &&
-                (null == predicate ? null == that.predicate : predicate.equals(that.predicate)) &&
-                (null == param ? null == that.param : param.equals(that.param)) );
-
+        return that == this || ((null != that)
+                && (null == predicate ? null == that.predicate : predicate.equals(that.predicate))
+                && (null == param ? null == that.param : param.equals(that.param)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "RightBoundPredicate".hashCode();
         if (null != predicate) {
@@ -81,16 +99,21 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "RightBoundPredicate<" + predicate + "(?," + param + ")>";
     }
 
+    /**
+     * Adapt a BinaryPredicate as a UnaryPredicate.
+     * @param predicate to adapt
+     * @param arg right side
+     * @return RightBoundPredicate
+     */
     public static RightBoundPredicate bind(BinaryPredicate predicate, Object arg) {
-        return null == predicate ? null : new RightBoundPredicate(predicate,arg);
+        return null == predicate ? null : new RightBoundPredicate(predicate, arg);
     }
 
-    /** The {@link BinaryPredicate BinaryPredicate} I'm wrapping. */
-    private BinaryPredicate predicate = null;
-    /** The parameter to pass to that predicate. */
-    private Object param = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryFunctionUnaryProcedure.java Fri Apr  4 16:08:18 2008
@@ -39,23 +39,6 @@
  */
 public final class UnaryFunctionUnaryProcedure implements UnaryProcedure, Serializable {
 
-    /**
-     * Adapt the given, possibly-<code>null</code>,
-     * {@link UnaryFunction UnaryFunction} to the
-     * {@link UnaryProcedure UnaryProcedure} interface.
-     * When the given <code>UnaryFunction</code> is <code>null</code>,
-     * returns <code>null</code>.
-     *
-     * @param function the possibly-<code>null</code>
-     *        {@link UnaryFunction UnaryFunction} to adapt
-     * @return a {@link UnaryProcedure UnaryProcedure} wrapping the given
-     *         {@link UnaryFunction UnaryFunction}, or <code>null</code>
-     *         if the given <code>UnaryFunction</code> is <code>null</code>
-     */
-    public static UnaryFunctionUnaryProcedure adapt(UnaryFunction function) {
-        return null == function ? null : new UnaryFunctionUnaryProcedure(function);
-    }
-
     /** The {@link UnaryFunction UnaryFunction} I'm wrapping. */
     private UnaryFunction function = null;
 
@@ -71,6 +54,7 @@
     /**
      * {@link UnaryFunction#evaluate Evaluate} my function, but
      * ignore its returned value.
+     * {@inheritDoc}
      */
     public void run(Object obj) {
         function.evaluate(obj);
@@ -113,6 +97,23 @@
      */
     public String toString() {
         return "UnaryFunctionUnaryProcedure<" + function + ">";
+    }
+
+    /**
+     * Adapt the given, possibly-<code>null</code>,
+     * {@link UnaryFunction UnaryFunction} to the
+     * {@link UnaryProcedure UnaryProcedure} interface.
+     * When the given <code>UnaryFunction</code> is <code>null</code>,
+     * returns <code>null</code>.
+     *
+     * @param function the possibly-<code>null</code>
+     *        {@link UnaryFunction UnaryFunction} to adapt
+     * @return a {@link UnaryProcedure UnaryProcedure} wrapping the given
+     *         {@link UnaryFunction UnaryFunction}, or <code>null</code>
+     *         if the given <code>UnaryFunction</code> is <code>null</code>
+     */
+    public static UnaryFunctionUnaryProcedure adapt(UnaryFunction function) {
+        return null == function ? null : new UnaryFunctionUnaryProcedure(function);
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Constant.java Fri Apr  4 16:08:18 2008
@@ -41,44 +41,84 @@
  * @version $Revision$ $Date$
  * @author Rodney Waldhoff
  */
-public final class Constant implements Function, UnaryFunction, BinaryFunction, Predicate, UnaryPredicate, BinaryPredicate, Serializable {
+public final class Constant implements Function, UnaryFunction, BinaryFunction, Predicate, UnaryPredicate,
+        BinaryPredicate, Serializable {
+
+    // static attributes
+    // ------------------------------------------------------------------------
+    private static final Constant TRUE_PREDICATE = new Constant(true);
+    private static final Constant FALSE_PREDICATE = new Constant(false);
+
+    // attributes
+    // ------------------------------------------------------------------------
+    private Object value;
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new Constant.
+     * @param value boolean
+     */
     public Constant(boolean value) {
+        //TODO use Boolean.TRUE and Boolean.FALSE
         this(new Boolean(value));
     }
 
+    /**
+     * Create a new Constant.
+     * @param value Object
+     */
     public Constant(Object value) {
         this.value = value;
     }
 
     // function interface
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate() {
         return value;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object obj) {
         return evaluate();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object left, Object right) {
         return evaluate();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test() {
         return ((Boolean) evaluate()).booleanValue();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object obj) {
         return test();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object left, Object right) {
         return test();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof Constant) {
             return equals((Constant) that);
@@ -87,10 +127,18 @@
         }
     }
 
+    /**
+     * Learn whether another Constant is equal to this.
+     * @param that Constant to test
+     * @return boolean
+     */
     public boolean equals(Constant that) {
         return (null != that && (null == this.value ? null == that.value : this.value.equals(that.value)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "Constant".hashCode();
         if (null != value) {
@@ -99,14 +147,13 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "Constant<" + String.valueOf(value) + ">";
     }
 
-    // attributes
-    // ------------------------------------------------------------------------
-    private Object value;
-
     // static methods
     // ------------------------------------------------------------------------
 
@@ -141,12 +188,13 @@
         return value ? TRUE_PREDICATE : FALSE_PREDICATE;
     }
 
+    /**
+     * Get a Constant instance for the specified value.
+     * @param value Object
+     * @return Constant
+     */
     public static Constant instance(Object value) {
         return new Constant(value);
     }
 
-    // static attributes
-    // ------------------------------------------------------------------------
-    private static final Constant TRUE_PREDICATE = new Constant(true);
-    private static final Constant FALSE_PREDICATE = new Constant(false);
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Identity.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Identity.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Identity.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Identity.java Fri Apr  4 16:08:18 2008
@@ -35,17 +35,6 @@
  */
 public final class Identity implements UnaryFunction, UnaryPredicate, Serializable {
 
-    // static methods
-    // ------------------------------------------------------------------------
-
-    /**
-     * Get an Identity instance.
-     * @return Identity
-     */
-    public static Identity instance() {
-        return INSTANCE;
-    }
-
     // static attributes
     // ------------------------------------------------------------------------
     private static final Identity INSTANCE = new Identity();
@@ -77,9 +66,9 @@
     }
 
     /**
-     * 
-     * @param bool
-     * @return
+     * Test a Boolean object by returning its <code>booleanValue</code>.
+     * @param bool Boolean
+     * @return boolean
      */
     public boolean test(Boolean bool) {
         return bool.booleanValue();
@@ -104,6 +93,17 @@
      */
     public String toString() {
         return "Identity";
+    }
+
+    // static methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Get an Identity instance.
+     * @return Identity
+     */
+    public static Identity instance() {
+        return INSTANCE;
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsInstanceOf.java Fri Apr  4 16:08:18 2008
@@ -31,19 +31,32 @@
  */
 public final class IsInstanceOf implements UnaryPredicate, Serializable {
 
+    // attributes
+    // ------------------------------------------------------------------------
+    private Class klass;
+
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new IsInstanceOf.
+     * @param klass
+     */
     public IsInstanceOf(Class klass) {
         this.klass = klass;
     }
 
     // predicate interface
     // ------------------------------------------------------------------------
-
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object obj) {
         return klass.isInstance(obj);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof IsInstanceOf) {
             return equals((IsInstanceOf) that);
@@ -52,10 +65,18 @@
         }
     }
 
+    /**
+     * Learn whether another IsInstanceOf is equal to this.
+     * @param that IsInstanceOf to test
+     * @return boolean
+     */
     public boolean equals(IsInstanceOf that) {
         return (null != that && (null == this.klass ? null == that.klass : this.klass.equals(that.klass)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "IsInstanceOf".hashCode();
         if (null != klass) {
@@ -64,12 +85,11 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "IsInstanceOf<" + klass + ">";
     }
-
-    // attributes
-    // ------------------------------------------------------------------------
-    private Class klass;
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java Fri Apr  4 16:08:18 2008
@@ -35,46 +35,72 @@
  */
 public final class RightIdentity implements BinaryPredicate, BinaryFunction, Serializable {
 
-    // static methods
-    // ------------------------------------------------------------------------
-    public static RightIdentity instance() {
-        return INSTANCE;
-    }
-
     // static attributes
     // ------------------------------------------------------------------------
     private static final RightIdentity INSTANCE = new RightIdentity();
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new RightIdentity.
+     */
     public RightIdentity() {
     }
 
     // functor interface
     // ------------------------------------------------------------------------
-
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object left, Object right) {
         return right;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object left, Object right) {
         return test((Boolean) right);
     }
 
+    /**
+     * Test a Boolean.
+     * @param bool to test
+     * @return boolean
+     */
     private boolean test(Boolean bool) {
         return bool.booleanValue();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         return (that instanceof RightIdentity);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         return "RightIdentity".hashCode();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "RightIdentity";
+    }
+
+    // static methods
+    // ------------------------------------------------------------------------
+    /**
+     * Get a RightIdentity instance.
+     * @return RightIdentity
+     */
+    public static RightIdentity instance() {
+        return INSTANCE;
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/IsEmpty.java Fri Apr  4 16:08:18 2008
@@ -31,24 +31,21 @@
 
     // class variables
     // ------------------------------------------------------------------------
-    
+
     private static final IsEmpty INSTANCE = new IsEmpty();
-    
-    // class methods
-    // ------------------------------------------------------------------------
-    
-    public static final IsEmpty instance() {
-        return INSTANCE;
-    }
-    
+
     // constructor
     // ------------------------------------------------------------------------
-
+    /**
+     * Create a new IsEmpty.
+     */
     public IsEmpty() { }
 
     // instance methods
     // ------------------------------------------------------------------------
-
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object obj) {
         if (obj instanceof Collection) {
             return testCollection((Collection) obj);
@@ -66,40 +63,70 @@
     }
 
     /**
-     * @see java.lang.Object#equals(Object)
+     * {@inheritDoc}
      */
     public boolean equals(Object that) {
         return that instanceof IsEmpty;
     }
 
     /**
-     * @see java.lang.Object#hashCode()
+     * {@inheritDoc}
      */
     public int hashCode() {
         return "IsEmpty".hashCode();
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * {@inheritDoc}
      */
     public String toString() {
         return "IsEmpty()";
     }
 
+    /**
+     * Test a collection.
+     * @param col to test
+     * @return boolean
+     */
     private boolean testCollection(Collection col) {
         return col.isEmpty();
     }
 
+    /**
+     * Test a map.
+     * @param map to test
+     * @return boolean
+     */
     private boolean testMap(Map map) {
         return map.isEmpty();
     }
 
+    /**
+     * Test a string.
+     * @param str to test
+     * @return boolean
+     */
     private boolean testString(String str) {
         return 0 == str.length();
     }
 
+    /**
+     * Test an array.
+     * @param array to test
+     * @return boolean
+     */
     private boolean testArray(Object array) {
         return 0 == Array.getLength(array);
+    }
+
+    // static
+    // ------------------------------------------------------------------------
+    /**
+     * Get an IsEmpty instance.
+     * @return IsEmpty
+     */
+    public static final IsEmpty instance() {
+        return INSTANCE;
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/Size.java Fri Apr  4 16:08:18 2008
@@ -30,11 +30,18 @@
  */
 public final class Size implements UnaryFunction, Serializable {
 
+    private static final Size INSTANCE = new Size();
+
     // constructor
     // ------------------------------------------------------------------------
-
+    /**
+     * Create a new Size.
+     */
     public Size() { }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object obj) {
         if (obj instanceof Collection) {
             return evaluate((Collection) obj);
@@ -42,7 +49,7 @@
             return evaluate((String) obj);
         } else if (null != obj && obj.getClass().isArray()) {
             return evaluateArray(obj);
-        } else if (null == obj){
+        } else if (null == obj) {
             throw new NullPointerException("Argument must not be null");
         } else {
             throw new ClassCastException("Expected Collection, String or Array, found " + obj);
@@ -50,42 +57,59 @@
     }
 
     /**
-     * @see java.lang.Object#equals(Object)
+     * {@inheritDoc}
      */
     public boolean equals(Object that) {
         return that instanceof Size;
     }
 
     /**
-     * @see java.lang.Object#hashCode()
+     * {@inheritDoc}
      */
     public int hashCode() {
         return "Size".hashCode();
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * {@inheritDoc}
      */
     public String toString() {
         return "Size()";
     }
 
+    /**
+     * Get a Size instance.
+     * @return Size
+     */
     public static final Size instance() {
         return INSTANCE;
     }
 
+    /**
+     * Evaluate a Collection.
+     * @param col to evaluate
+     * @return Integer
+     */
     private Object evaluate(Collection col) {
         return new Integer(col.size());
     }
 
+    /**
+     * Evaluate a String.
+     * @param str to evaluate
+     * @return Integer
+     */
     private Object evaluate(String str) {
         return new Integer(str.length());
     }
 
+    /**
+     * Evaluate an array.
+     * @param array to evaluate
+     * @return Integer
+     */
     private Object evaluateArray(Object array) {
         return new Integer(Array.getLength(array));
     }
-
-    private static final Size INSTANCE = new Size();
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java Fri Apr  4 16:08:18 2008
@@ -40,7 +40,7 @@
 
     /**
      * Create a new ComparatorFunction.
-     * @param comparator
+     * @param comparator to wrap
      */
     public ComparatorFunction(Comparator comparator) {
         this.comparator = null == comparator ? ComparableComparator.instance() : comparator;

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java Fri Apr  4 16:08:18 2008
@@ -37,6 +37,10 @@
  *
  */
 public final class IsEquivalent implements BinaryPredicate, Serializable {
+    private static final IsEquivalent COMPARABLE_INSTANCE = new IsEquivalent();
+
+    private Comparator comparator = null;
+
     /**
      * Construct an <code>IsEquivalent</code> {@link BinaryPredicate predicate}
      * for {@link Comparable Comparable}s.
@@ -61,13 +65,14 @@
      * Return <code>true</code> iff the <i>left</i> parameter is
      * equal to the <i>right</i> parameter under my current
      * {@link Comparator Comparator}.
+     * {@inheritDoc}
      */
     public boolean test(Object left, Object right) {
-        return comparator.compare(left,right) == 0;
+        return comparator.compare(left, right) == 0;
     }
 
     /**
-     * @see java.lang.Object#equals(Object)
+     * {@inheritDoc}
      */
     public boolean equals(Object that) {
         if (that instanceof IsEquivalent) {
@@ -78,15 +83,16 @@
     }
 
     /**
-     * @see #equals(Object)
+     * Learn whether a given IsEquivalent is equal to this.
+     * @param that IsEquivalent to test
+     * @return boolean
      */
     public boolean equals(IsEquivalent that) {
-        return null != that &&
-            null == comparator ? null == that.comparator : comparator.equals(that.comparator);
+        return null != that && null == comparator ? null == that.comparator : comparator.equals(that.comparator);
     }
 
     /**
-     * @see java.lang.Object#hashCode()
+     * {@inheritDoc}
      */
     public int hashCode() {
         int hash = "IsEquivalent".hashCode();
@@ -96,20 +102,27 @@
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * {@inheritDoc}
      */
     public String toString() {
         return "IsEquivalent<" + comparator + ">";
     }
 
+    /**
+     * Get a basic IsEquivalent instance.
+     * @return IsEquivalent
+     */
     public static final IsEquivalent instance() {
         return COMPARABLE_INSTANCE;
     }
 
+    /**
+     * Get an IsEquivalent instance that always compares to <code>arg</code>.
+     * @param right argument
+     * @return UnaryPredicate
+     */
     public static final UnaryPredicate instance(Comparable right) {
-        return RightBoundPredicate.bind(instance(),right);
+        return RightBoundPredicate.bind(instance(), right);
     }
 
-    private Comparator comparator = null;
-    private static final IsEquivalent COMPARABLE_INSTANCE = new IsEquivalent();
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java Fri Apr  4 16:08:18 2008
@@ -36,23 +36,6 @@
 public final class IsGreaterThan implements BinaryPredicate, Serializable {
     private static final IsGreaterThan COMPARABLE_INSTANCE = new IsGreaterThan();
 
-    /**
-     * Get a basic IsGreaterThan instance.
-     * @return IsGreaterThan
-     */
-    public static final IsGreaterThan instance() {
-        return COMPARABLE_INSTANCE;
-    }
-
-    /**
-     * Get an IsGreaterThan UnaryPredicate
-     * @param right the right side object of the IsGreaterThan comparison
-     * @return UnaryPredicate
-     */
-    public static final UnaryPredicate instance(Comparable right) {
-        return RightBoundPredicate.bind(instance(),right);
-    }
-
     private Comparator comparator = null;
 
     /**
@@ -79,6 +62,7 @@
      * Return <code>true</code> iff the <i>left</i> parameter is
      * greater than the <i>right</i> parameter under my current
      * {@link Comparator Comparator}.
+     * {@inheritDoc}
      */
     public boolean test(Object left, Object right) {
         return comparator.compare(left, right) > 0;
@@ -119,6 +103,23 @@
      */
     public String toString() {
         return "IsGreaterThan<" + comparator + ">";
+    }
+
+    /**
+     * Get a basic IsGreaterThan instance.
+     * @return IsGreaterThan
+     */
+    public static final IsGreaterThan instance() {
+        return COMPARABLE_INSTANCE;
+    }
+
+    /**
+     * Get an IsGreaterThan UnaryPredicate.
+     * @param right the right side object of the IsGreaterThan comparison
+     * @return UnaryPredicate
+     */
+    public static final UnaryPredicate instance(Comparable right) {
+        return RightBoundPredicate.bind(instance(), right);
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java Fri Apr  4 16:08:18 2008
@@ -34,6 +34,10 @@
  * @author Rodney Waldhoff
  */
 public final class IsGreaterThanOrEqual implements BinaryPredicate, Serializable {
+    private static final IsGreaterThanOrEqual COMPARABLE_INSTANCE = new IsGreaterThanOrEqual();
+
+    private Comparator comparator = null;
+
     /**
      * Construct a <code>IsGreaterThanOrEqual</code> {@link BinaryPredicate predicate}
      * for {@link Comparable Comparable}s.
@@ -58,13 +62,14 @@
      * Return <code>true</code> iff the <i>left</i> parameter is
      * greater than or equal to the <i>right</i> parameter under my current
      * {@link Comparator Comparator}.
+     * {@inheritDoc}
      */
     public boolean test(Object left, Object right) {
-        return comparator.compare(left,right) >= 0;
+        return comparator.compare(left, right) >= 0;
     }
 
     /**
-     * @see java.lang.Object#equals(Object)
+     * {@inheritDoc}
      */
     public boolean equals(Object that) {
         if (that instanceof IsGreaterThanOrEqual) {
@@ -75,15 +80,16 @@
     }
 
     /**
-     * @see #equals(Object)
+     * Learn whether another IsGreaterThanOrEqual is equal to this.
+     * @param that IsGreaterThanOrEqual to test
+     * @return boolean
      */
     public boolean equals(IsGreaterThanOrEqual that) {
-        return null != that &&
-            null == comparator ? null == that.comparator : comparator.equals(that.comparator);
+        return null != that && null == comparator ? null == that.comparator : comparator.equals(that.comparator);
     }
 
     /**
-     * @see java.lang.Object#hashCode()
+     * {@inheritDoc}
      */
     public int hashCode() {
         int hash = "IsGreaterThanOrEqual".hashCode();
@@ -93,20 +99,27 @@
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * {@inheritDoc}
      */
     public String toString() {
         return "IsGreaterThanOrEqual<" + comparator + ">";
     }
 
+    /**
+     * Get a basic IsGreaterThanOrEqual instance.
+     * @return IsGreaterThanOrEqual
+     */
     public static final IsGreaterThanOrEqual instance() {
         return COMPARABLE_INSTANCE;
     }
 
+    /**
+     * Get an IsGreaterThanOrEqual UnaryPredicate.
+     * @param right the right side object of the IsGreaterThanOrEqual comparison
+     * @return UnaryPredicate
+     */
     public static final UnaryPredicate instance(Comparable right) {
-        return RightBoundPredicate.bind(instance(),right);
+        return RightBoundPredicate.bind(instance(), right);
     }
 
-    private Comparator comparator = null;
-    private static final IsGreaterThanOrEqual COMPARABLE_INSTANCE = new IsGreaterThanOrEqual();
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java Fri Apr  4 16:08:18 2008
@@ -36,23 +36,6 @@
 public final class IsLessThan implements BinaryPredicate, Serializable {
     private static final IsLessThan COMPARABLE_INSTANCE = new IsLessThan();
 
-    /**
-     * Get a basic IsLessThan instance.
-     * @return IsLessThan
-     */
-    public static final IsLessThan instance() {
-        return COMPARABLE_INSTANCE;
-    }
-
-    /**
-     * Get an IsLessThan UnaryPredicate.
-     * @param right the right side object of the comparison.
-     * @return UnaryPredicate
-     */
-    public static final UnaryPredicate instance(Comparable right) {
-        return RightBoundPredicate.bind(instance(),right);
-    }
-
     private Comparator comparator = null;
 
     /**
@@ -79,6 +62,7 @@
      * Return <code>true</code> iff the <i>left</i> parameter is
      * less than the <i>right</i> parameter under my current
      * {@link Comparator Comparator}.
+     * {@inheritDoc}
      */
     public boolean test(Object left, Object right) {
         return comparator.compare(left, right) < 0;
@@ -101,8 +85,7 @@
      * @return boolean
      */
     public boolean equals(IsLessThan that) {
-        return null != that &&
-            null == comparator ? null == that.comparator : comparator.equals(that.comparator);
+        return null != that && null == comparator ? null == that.comparator : comparator.equals(that.comparator);
     }
 
     /**
@@ -120,6 +103,23 @@
      */
     public String toString() {
         return "IsLessThan<" + comparator + ">";
+    }
+
+    /**
+     * Get a basic IsLessThan instance.
+     * @return IsLessThan
+     */
+    public static final IsLessThan instance() {
+        return COMPARABLE_INSTANCE;
+    }
+
+    /**
+     * Get an IsLessThan UnaryPredicate.
+     * @param right the right side object of the comparison.
+     * @return UnaryPredicate
+     */
+    public static final UnaryPredicate instance(Comparable right) {
+        return RightBoundPredicate.bind(instance(), right);
     }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java Fri Apr  4 16:08:18 2008
@@ -35,7 +35,7 @@
  */
 public final class IsLessThanOrEqual implements BinaryPredicate, Serializable {
     private static final IsLessThanOrEqual COMPARABLE_INSTANCE = new IsLessThanOrEqual();
-    
+
     private Comparator comparator = null;
 
     /**
@@ -59,6 +59,7 @@
     }
 
     /**
+     * {@inheritDoc}
      * Return <code>true</code> iff the <i>left</i> parameter is
      * less than or equal to the <i>right</i> parameter under my current
      * {@link Comparator Comparator}.
@@ -68,7 +69,7 @@
     }
 
     /**
-     * @see java.lang.Object#equals(Object)
+     * {@inheritDoc}
      */
     public boolean equals(Object that) {
         if (that instanceof IsLessThanOrEqual) {
@@ -79,14 +80,16 @@
     }
 
     /**
-     * @see #equals(Object)
+     * Learn whether another IsLessThanOrEqual is equal to this.
+     * @param that the IsLessThanOrEqual to test.
+     * @return boolean
      */
     public boolean equals(IsLessThanOrEqual that) {
         return null != that && null == comparator ? null == that.comparator : comparator.equals(that.comparator);
     }
 
     /**
-     * @see java.lang.Object#hashCode()
+     * {@inheritDoc}
      */
     public int hashCode() {
         int hash = "IsLessThanOrEqual".hashCode();
@@ -96,17 +99,27 @@
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * {@inheritDoc}
      */
     public String toString() {
         return "IsLessThanOrEqual<" + comparator + ">";
     }
 
+    /**
+     * Get a basic IsLessThanOrEqual instance.
+     * @return IsLessThanOrEqual
+     */
     public static final IsLessThanOrEqual instance() {
         return COMPARABLE_INSTANCE;
     }
 
+    /**
+     * Get an IsLessThanOrEqual UnaryPredicate.
+     * @param right the right side object of the comparison.
+     * @return UnaryPredicate
+     */
     public static final UnaryPredicate instance(Comparable right) {
         return RightBoundPredicate.bind(instance(), right);
     }
+
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/And.java Fri Apr  4 16:08:18 2008
@@ -49,7 +49,7 @@
 
     /**
      * Create a new And.
-     * @param p
+     * @param p Predicate to add
      */
     public And(Predicate p) {
         super(p);
@@ -57,8 +57,8 @@
 
     /**
      * Create a new And.
-     * @param p
-     * @param q
+     * @param p Predicate to add
+     * @param q Predicate to add
      */
     public And(Predicate p, Predicate q) {
         super(p, q);
@@ -66,9 +66,9 @@
 
     /**
      * Create a new And.
-     * @param p
-     * @param q
-     * @param r
+     * @param p Predicate to add
+     * @param q Predicate to add
+     * @param r Predicate to add
      */
     public And(Predicate p, Predicate q, Predicate r) {
         super(p, q, r);
@@ -77,9 +77,9 @@
     // modifiers
     // ------------------------------------------------------------------------
     /**
-     * 
-     * @param p
-     * @return
+     * Add a Predicate.
+     * @param p Predicate to add
+     * @return this
      */
     public And and(Predicate p) {
         super.addPredicate(p);

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseBinaryPredicateList.java Fri Apr  4 16:08:18 2008
@@ -39,20 +39,42 @@
  */
 abstract class BaseBinaryPredicateList implements BinaryPredicate, Serializable {
 
+    // attributes
+    // ------------------------------------------------------------------------
+    private List list = new ArrayList();
+
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new BaseBinaryPredicateList.
+     */
     protected BaseBinaryPredicateList() {
     }
 
+    /**
+     * Create a new BaseBinaryPredicateList.
+     * @param p BinaryPredicate to add
+     */
     protected BaseBinaryPredicateList(BinaryPredicate p) {
         addBinaryPredicate(p);
     }
 
+    /**
+     * Create a new BaseBinaryPredicateList.
+     * @param p BinaryPredicate to add
+     * @param q BinaryPredicate to add
+     */
     protected BaseBinaryPredicateList(BinaryPredicate p, BinaryPredicate q) {
         addBinaryPredicate(p);
         addBinaryPredicate(q);
     }
 
+    /**
+     * Create a new BaseBinaryPredicateList.
+     * @param p BinaryPredicate to add
+     * @param q BinaryPredicate to add
+     * @param r BinaryPredicate to add
+     */
     protected BaseBinaryPredicateList(BinaryPredicate p, BinaryPredicate q, BinaryPredicate r) {
         addBinaryPredicate(p);
         addBinaryPredicate(q);
@@ -61,38 +83,69 @@
 
     // abstract
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public abstract boolean equals(Object that);
+
+    /**
+     * {@inheritDoc}
+     */
     public abstract int hashCode();
+
+    /**
+     * {@inheritDoc}
+     */
     public abstract String toString();
+
+    /**
+     * {@inheritDoc}
+     */
     public abstract boolean test(Object left, Object right);
 
     // modifiers
     // ------------------------------------------------------------------------
+    /**
+     * Add a BinaryPredicate to the list
+     * @param p BinaryPredicate to add
+     */
     protected void addBinaryPredicate(BinaryPredicate p) {
         list.add(p);
     }
 
     // protected
     // ------------------------------------------------------------------------
-
+    /**
+     * Get an Iterator over the list contents.
+     * @return Iterator
+     */
     protected Iterator getBinaryPredicateIterator() {
         return list.iterator();
     }
 
+    /**
+     * Learn whether another list is equal to this one.
+     * @param that BaseBinaryPredicateList to test
+     * @return boolean
+     */
     protected boolean getBinaryPredicateListEquals(BaseBinaryPredicateList that) {
         return (null != that && this.list.equals(that.list));
     }
 
+    /**
+     * Get a hashCode for the list.
+     * @return int
+     */
     protected int getBinaryPredicateListHashCode() {
         return list.hashCode();
     }
 
+    /**
+     * Get a toString for the list.
+     * @return String
+     */
     protected String getBinaryPredicateListToString() {
         return String.valueOf(list);
     }
-
-    // attributes
-    // ------------------------------------------------------------------------
-    private List list = new ArrayList();
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java Fri Apr  4 16:08:18 2008
@@ -38,7 +38,7 @@
  * @author Rodney Waldhoff
  */
 abstract class BaseUnaryPredicateList implements UnaryPredicate, Serializable {
-    
+
     // attributes
     // ------------------------------------------------------------------------
     private List list = new ArrayList();
@@ -53,7 +53,7 @@
 
     /**
      * Create a new BaseUnaryPredicateList.
-     * @param p
+     * @param p single Predicate to add
      */
     protected BaseUnaryPredicateList(UnaryPredicate p) {
         addUnaryPredicate(p);
@@ -61,8 +61,8 @@
 
     /**
      * Create a new BaseUnaryPredicateList.
-     * @param p
-     * @param q
+     * @param p Predicate to add
+     * @param q Predicate to add
      */
     protected BaseUnaryPredicateList(UnaryPredicate p, UnaryPredicate q) {
         addUnaryPredicate(p);
@@ -71,9 +71,9 @@
 
     /**
      * Create a new BaseUnaryPredicateList.
-     * @param p
-     * @param q
-     * @param r
+     * @param p Predicate to add
+     * @param q Predicate to add
+     * @param r Predicate to add
      */
     protected BaseUnaryPredicateList(UnaryPredicate p, UnaryPredicate q, UnaryPredicate r) {
         addUnaryPredicate(p);

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryAnd.java Fri Apr  4 16:08:18 2008
@@ -40,24 +40,47 @@
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new BinaryAnd.
+     */
     public BinaryAnd() {
         super();
     }
 
+    /**
+     * Create a new BinaryAnd.
+     * @param p BinaryPredicate to add
+     */
     public BinaryAnd(BinaryPredicate p) {
         super(p);
     }
 
+    /**
+     * Create a new BinaryAnd.
+     * @param p BinaryPredicate to add
+     * @param q BinaryPredicate to add
+     */
     public BinaryAnd(BinaryPredicate p, BinaryPredicate q) {
         super(p, q);
     }
 
+    /**
+     * Create a new BinaryAnd.
+     * @param p BinaryPredicate to add
+     * @param q BinaryPredicate to add
+     * @param r BinaryPredicate to add
+     */
     public BinaryAnd(BinaryPredicate p, BinaryPredicate q, BinaryPredicate r) {
         super(p, q, r);
     }
 
     // modifiers
     // ------------------------------------------------------------------------
+    /**
+     * And in a BinaryPredicate.
+     * @param p BinaryPredicate to add
+     * @return this
+     */
     public BinaryAnd and(BinaryPredicate p) {
         super.addBinaryPredicate(p);
         return this;
@@ -65,6 +88,9 @@
 
     // predicate interface
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object a, Object b) {
         for (Iterator iter = getBinaryPredicateIterator(); iter.hasNext();) {
             if (!((BinaryPredicate) iter.next()).test(a, b)) {
@@ -74,6 +100,9 @@
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof BinaryAnd) {
             return equals((BinaryAnd) that);
@@ -82,14 +111,25 @@
         }
     }
 
+    /**
+     * Learn whether another BinaryAnd is equal to this.
+     * @param that the BinaryAnd to test
+     * @return boolean
+     */
     public boolean equals(BinaryAnd that) {
         return getBinaryPredicateListEquals(that);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         return "BinaryAnd".hashCode() ^ getBinaryPredicateListHashCode();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "BinaryAnd<" + getBinaryPredicateListToString() + ">";
     }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java Fri Apr  4 16:08:18 2008
@@ -35,20 +35,32 @@
  * @author Rodney Waldhoff
  */
 public final class BinaryNot implements BinaryPredicate, Serializable {
+    // attributes
+    // ------------------------------------------------------------------------
+    private BinaryPredicate predicate = null;
 
     // constructor
     // ------------------------------------------------------------------------
-
+    /**
+     * Create a new BinaryNot.
+     * @param p BinaryPredicate to negate
+     */
     public BinaryNot(BinaryPredicate p) {
         this.predicate = p;
     }
 
     // predicate interface
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object left, Object right) {
-        return !(predicate.test(left,right));
+        return !(predicate.test(left, right));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof BinaryNot) {
             return equals((BinaryNot) that);
@@ -57,10 +69,18 @@
         }
     }
 
+    /**
+     * Learn whether another BinaryNot is equal to this.
+     * @param that BinaryNot to test
+     * @return boolean
+     */
     public boolean equals(BinaryNot that) {
         return null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "BinaryNot".hashCode();
         if (null != predicate) {
@@ -69,17 +89,22 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "BinaryNot<" + predicate + ">";
     }
 
     // static
     // ------------------------------------------------------------------------
+    /**
+     * Negate a BinaryPredicate.
+     * @param that BinaryPredicate to negate
+     * @return BinaryPredicate
+     */
     public static BinaryPredicate not(BinaryPredicate that) {
         return null == that ? null : new BinaryNot(that);
     }
 
-    // attributes
-    // ------------------------------------------------------------------------
-    private BinaryPredicate predicate = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinarySequence.java Fri Apr  4 16:08:18 2008
@@ -42,23 +42,41 @@
  * @author Rodney Waldhoff
  */
 public class BinarySequence implements BinaryProcedure, Serializable {
+    // attributes
+    // ------------------------------------------------------------------------
+    private List list = new ArrayList();
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new BinarySequence.
+     */
     public BinarySequence() {
     }
 
+    /**
+     * Create a new BinarySequence.
+     * @param p BinaryProcedure to add
+     */
     public BinarySequence(BinaryProcedure p) {
         then(p);
     }
 
+    /**
+     * Create a new BinarySequence.
+     * @param p BinaryProcedure to add
+     * @param q BinaryProcedure to add
+     */
     public BinarySequence(BinaryProcedure p, BinaryProcedure q) {
         then(p);
         then(q);
     }
 
-    // modifiers
-    // ------------------------------------------------------------------------
+    /**
+     * Fluently add a BinaryProcedure.
+     * @param p BinaryProcedure to add
+     * @return this
+     */
     public BinarySequence then(BinaryProcedure p) {
         list.add(p);
         return this;
@@ -66,12 +84,18 @@
 
     // predicate interface
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public void run(Object left, Object right) {
         for (ListIterator iter = list.listIterator(list.size()); iter.hasPrevious();) {
-            ((BinaryProcedure) iter.previous()).run(left,right);
+            ((BinaryProcedure) iter.previous()).run(left, right);
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof BinarySequence) {
             return equals((BinarySequence) that);
@@ -80,23 +104,29 @@
         }
     }
 
+    /**
+     * Learn whether another BinarySequence is equal to this.
+     * @param that BinarySequence to test
+     * @return boolean
+     */
     public boolean equals(BinarySequence that) {
         // by construction, list is never null
         return null != that && list.equals(that.list);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         // by construction, list is never null
         return "BinarySequence".hashCode() ^ list.hashCode();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "BinarySequence<" + list + ">";
     }
-
-
-    // attributes
-    // ------------------------------------------------------------------------
-    private List list = new ArrayList();
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java Fri Apr  4 16:08:18 2008
@@ -45,15 +45,29 @@
  * @author Rodney Waldhoff
  */
 public final class CompositeUnaryPredicate implements UnaryPredicate, Serializable {
+    // attributes
+    // ------------------------------------------------------------------------
+    private CompositeUnaryFunction function = null;
+    private UnaryPredicate predicate = null;
 
+    //TODO have somebody who understands this class better write the missing javadoc!
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new CompositeUnaryPredicate.
+     * @param p
+     */
     public CompositeUnaryPredicate(UnaryPredicate p) {
         if (null == p) { throw new NullPointerException(); }
         this.predicate = p;
         this.function = new CompositeUnaryFunction();
     }
 
+    /**
+     * Create a new CompositeUnaryPredicate.
+     * @param p
+     * @param f
+     */
     public CompositeUnaryPredicate(UnaryPredicate p, UnaryFunction f) {
         if (null == p) { throw new NullPointerException(); }
         if (null == f) { throw new NullPointerException(); }
@@ -63,6 +77,11 @@
 
     // modifiers
     // ------------------------------------------------------------------------
+    /**
+     * 
+     * @param f
+     * @return
+     */
     public CompositeUnaryPredicate of(UnaryFunction f) {
         function.of(f);
         return this;
@@ -70,10 +89,16 @@
 
     // predicate interface
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object obj) {
         return predicate.test(function.evaluate(obj));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof CompositeUnaryPredicate) {
             return equals((CompositeUnaryPredicate) that);
@@ -82,10 +107,18 @@
         }
     }
 
+    /**
+     * Learn whether another CompositeUnaryPredicate is equal to this.
+     * @param that CompositeUnaryPredicate to test
+     * @return boolean
+     */
     public boolean equals(CompositeUnaryPredicate that) {
         return null != that && predicate.equals(that.predicate) && function.equals(that.function);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "CompositeUnaryPredicate".hashCode();
         hash <<= 2;
@@ -95,13 +128,11 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "CompositeUnaryFunction<" + predicate + ";" + function + ">";
     }
-
-    // attributes
-    // ------------------------------------------------------------------------
-    private CompositeUnaryFunction function = null;
-    private UnaryPredicate predicate = null;
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Conditional.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Conditional.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Conditional.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Conditional.java Fri Apr  4 16:08:18 2008
@@ -42,9 +42,9 @@
 
     /**
      * Create a conditional procedure.
-     * @param q
-     * @param r
-     * @param s
+     * @param q if
+     * @param r then
+     * @param s else
      * @return UnaryProcedure
      */
     public static final UnaryProcedure procedure(UnaryPredicate q, UnaryProcedure r, UnaryProcedure s) {
@@ -52,10 +52,10 @@
     }
 
     /**
-     * 
-     * @param q
-     * @param r
-     * @param s
+     * Create a conditional function.
+     * @param q if
+     * @param r then
+     * @param s else
      * @return UnaryFunction
      */
     public static final UnaryFunction function(UnaryPredicate q, UnaryFunction r, UnaryFunction s) {
@@ -63,10 +63,10 @@
     }
 
     /**
-     * 
-     * @param q
-     * @param r
-     * @param s
+     * Create a conditional predicate.
+     * @param q if
+     * @param r then
+     * @param s else
      * @return UnaryPredicate
      */
     public static final UnaryPredicate predicate(UnaryPredicate q, UnaryPredicate r, UnaryPredicate s) {
@@ -74,10 +74,10 @@
     }
 
     /**
-     * 
-     * @param q
-     * @param r
-     * @param s
+     * Create a conditional binary procedure.
+     * @param q if
+     * @param r then
+     * @param s else
      * @return BinaryProcedure
      */
     public static final BinaryProcedure procedure(BinaryPredicate q, BinaryProcedure r, BinaryProcedure s) {
@@ -85,10 +85,10 @@
     }
 
     /**
-     * 
-     * @param q
-     * @param r
-     * @param s
+     * Create a conditional binary function.
+     * @param q if
+     * @param r then
+     * @param s else
      * @return BinaryFunction
      */
     public static final BinaryFunction function(BinaryPredicate q, BinaryFunction r, BinaryFunction s) {
@@ -96,10 +96,10 @@
     }
 
     /**
-     * 
-     * @param q
-     * @param r
-     * @param s
+     * Create a conditional binary predicate.
+     * @param q if
+     * @param r then
+     * @param s else
      * @return BinaryPredicate
      */
     public static final BinaryPredicate predicate(BinaryPredicate q, BinaryPredicate r, BinaryPredicate s) {

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java?rev=644988&r1=644987&r2=644988&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java Fri Apr  4 16:08:18 2008
@@ -53,16 +53,16 @@
 
     /**
      * Create a new ConditionalBinaryProcedure.
-     * @param ifPred
-     * @param thenPred
-     * @param elsePred
+     * @param ifPred to evaluate
+     * @param thenPred if <code>ifPred</code> yields <code>true</code>
+     * @param elsePred if <code>ifPred</code> yields <code>false</code>
      */
     public ConditionalBinaryProcedure(BinaryPredicate ifPred, BinaryProcedure thenPred, BinaryProcedure elsePred) {
         this.ifPred = ifPred;
         this.thenProc = thenPred;
         this.elseProc = elsePred;
     }
-    
+
     // predicate interface
     // ------------------------------------------------------------------------
 



Mime
View raw message