commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r645735 [1/2] - in /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor: adapter/ core/ core/collection/ core/comparator/ core/composite/ generator/ generator/util/
Date Mon, 07 Apr 2008 23:29:30 GMT
Author: mbenson
Date: Mon Apr  7 16:29:25 2008
New Revision: 645735

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

Modified:
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsEqual.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotEqual.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotNull.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/LeftIdentity.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryOr.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Composite.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.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/ConditionalBinaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Or.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryAnd.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryOr.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/WhileDoProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/BaseGenerator.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/IntegerRange.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/util/LongRange.java

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryFunctionBinaryPredicate.java Mon Apr  7 16:29:25 2008
@@ -75,8 +75,9 @@
     }
 
     /**
-     * @param that
-     * @return
+     * Learn whether another BinaryFunctionBinaryPredicate is equal to this.
+     * @param that BinaryFunctionBinaryPredicate to test
+     * @return boolean
      */
     public boolean equals(BinaryFunctionBinaryPredicate that) {
         return that == this

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BinaryPredicateBinaryFunction.java Mon Apr  7 16:29:25 2008
@@ -38,11 +38,19 @@
  * @author Rodney Waldhoff
  */
 public final class BinaryPredicateBinaryFunction implements BinaryFunction, Serializable {
+    /** The {@link BinaryPredicate BinaryPredicate} I'm wrapping. */
+    private BinaryPredicate predicate = null;
+
+    /**
+     * Create a new BinaryPredicateBinaryFunction.
+     * @param predicate to adapt
+     */
     public BinaryPredicateBinaryFunction(BinaryPredicate predicate) {
         this.predicate = predicate;
     }
 
     /**
+     * {@inheritDoc}
      * Returns <code>Boolean.TRUE</code> (<code>Boolean.FALSE</code>)
      * when the {@link BinaryPredicate#test test} method of my underlying
      * predicate returns <code>true</code> (<code>false</code>).
@@ -50,9 +58,12 @@
      * @return a non-<code>null</code> <code>Boolean</code> instance
      */
     public Object evaluate(Object left, Object right) {
-        return predicate.test(left,right) ? Boolean.TRUE : Boolean.FALSE;
+        return predicate.test(left, right) ? Boolean.TRUE : Boolean.FALSE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof BinaryPredicateBinaryFunction) {
             return equals((BinaryPredicateBinaryFunction) that);
@@ -61,10 +72,19 @@
         }
     }
 
+    /**
+     * Learn whether another BinaryPredicateBinaryFunction is equal to this.
+     * @param that BinaryPredicateBinaryFunction to test
+     * @return boolean
+     */
     public boolean equals(BinaryPredicateBinaryFunction that) {
-        return that == this || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+        return that == this
+                || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "BinaryPredicateBinaryFunction".hashCode();
         if (null != predicate) {
@@ -73,11 +93,13 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "BinaryPredicateBinaryFunction<" + predicate + ">";
     }
 
-
     /**
      * Adapt the given, possibly-<code>null</code>,
      * {@link BinaryPredicate BinaryPredicate} to the
@@ -95,6 +117,4 @@
         return null == predicate ? null : new BinaryPredicateBinaryFunction(predicate);
     }
 
-    /** The {@link BinaryPredicate BinaryPredicate} I'm wrapping. */
-    private BinaryPredicate predicate = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundFunction.java Mon Apr  7 16:29:25 2008
@@ -39,7 +39,13 @@
  * @author Rodney Waldhoff
  */
 public final class BoundFunction implements Function, Serializable {
+    /** The {@link UnaryFunction UnaryFunction} I'm wrapping. */
+    private UnaryFunction function = null;
+    /** The parameter to pass to that function. */
+    private Object param = null;
+
     /**
+     * Create a new BoundFunction.
      * @param function the function to adapt
      * @param arg the constant argument to use
      */
@@ -48,10 +54,16 @@
         this.param = arg;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate() {
         return function.evaluate(param);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof BoundFunction) {
             return equals((BoundFunction) that);
@@ -60,14 +72,21 @@
         }
     }
 
+    /**
+     * Learn whether another BoundFunction is equal to this.
+     * @param that BoundFunction to test
+     * @return boolean
+     */
     public boolean equals(BoundFunction 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 = "BoundFunction".hashCode();
         if (null != function) {
@@ -81,6 +100,9 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "BoundFunction<" + function + "(" + param + ")>";
     }
@@ -102,11 +124,7 @@
      *         if the given <code>UnaryFunction</code> is <code>null</code>
      */
     public static BoundFunction bind(UnaryFunction function, Object arg) {
-        return null == function ? null : new BoundFunction(function,arg);
+        return null == function ? null : new BoundFunction(function, arg);
     }
 
-    /** The {@link UnaryFunction UnaryFunction} I'm wrapping. */
-    private UnaryFunction 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/BoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/BoundPredicate.java Mon Apr  7 16:29:25 2008
@@ -39,7 +39,13 @@
  * @author Rodney Waldhoff
  */
 public final class BoundPredicate implements Predicate, Serializable {
+    /** The {@link UnaryPredicate UnaryPredicate} I'm wrapping. */
+    private UnaryPredicate predicate = null;
+    /** The parameter to pass to that predicate. */
+    private Object param = null;
+
     /**
+     * Create a new BoundPredicate.
      * @param predicate the predicate to adapt
      * @param arg the constant argument to use
      */
@@ -48,10 +54,16 @@
         this.param = arg;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test() {
         return predicate.test(param);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof BoundPredicate) {
             return equals((BoundPredicate) that);
@@ -60,14 +72,21 @@
         }
     }
 
+    /**
+     * Learn whether another BoundPredicate is equal to this.
+     * @param that BoundPredicate to test
+     * @return boolean
+     */
     public boolean equals(BoundPredicate 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 = "BoundPredicate".hashCode();
         if (null != predicate) {
@@ -81,6 +100,9 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "BoundPredicate<" + predicate + "(" + param + ")>";
     }
@@ -102,11 +124,7 @@
      *         if the given <code>UnaryPredicate</code> is <code>null</code>
      */
     public static BoundPredicate bind(UnaryPredicate predicate, Object arg) {
-        return null == predicate ? null : new BoundPredicate(predicate,arg);
+        return null == predicate ? null : new BoundPredicate(predicate, arg);
     }
 
-    /** The {@link UnaryPredicate UnaryPredicate} I'm wrapping. */
-    private UnaryPredicate 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/FunctionProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionProcedure.java Mon Apr  7 16:29:25 2008
@@ -38,6 +38,9 @@
  * @author Rodney Waldhoff
  */
 public final class FunctionProcedure implements Procedure, Serializable {
+    /** The {@link Function Function} I'm wrapping. */
+    private Function function = null;
+
     /**
      * Create an {@link Procedure Procedure} wrapping
      * the given {@link Function Function}.
@@ -48,6 +51,7 @@
     }
 
     /**
+     * {@inheritDoc}
      * {@link Function#evaluate Evaluate} my function,
      * but ignore its returned value.
      */
@@ -55,6 +59,9 @@
         function.evaluate();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof FunctionProcedure) {
             return equals((FunctionProcedure) that);
@@ -63,10 +70,19 @@
         }
     }
 
+    /**
+     * Learn whether another FunctionProcedure is equal to this.
+     * @param that FunctionProcedure to test
+     * @return boolean
+     */
     public boolean equals(FunctionProcedure 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 = "FunctionProcedure".hashCode();
         if (null != function) {
@@ -75,9 +91,13 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "FunctionProcedure<" + function + ">";
     }
+
     /**
      * Adapt the given, possibly-<code>null</code>,
      * {@link Function Function} to the
@@ -95,6 +115,4 @@
         return null == function ? null : new FunctionProcedure(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/FunctionUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/FunctionUnaryFunction.java Mon Apr  7 16:29:25 2008
@@ -39,14 +39,27 @@
  * @author Rodney Waldhoff
  */
 public final class FunctionUnaryFunction implements UnaryFunction, Serializable {
+    /** The {@link Function Function} I'm wrapping. */
+    private Function function = null;
+
+    /**
+     * Create a new FunctionUnaryFunction.
+     * @param function to adapt
+     */
     public FunctionUnaryFunction(Function function) {
         this.function = function;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object obj) {
         return function.evaluate();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof FunctionUnaryFunction) {
             return equals((FunctionUnaryFunction) that);
@@ -55,10 +68,19 @@
         }
     }
 
+    /**
+     * Learn whether another FunctionUnaryFunction is equal to this.
+     * @param that FunctionUnaryFunction to test
+     * @return boolean
+     */
     public boolean equals(FunctionUnaryFunction 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 = "FunctionUnaryFunction".hashCode();
         if (null != function) {
@@ -67,14 +89,20 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "FunctionUnaryFunction<" + function + ">";
     }
 
+    /**
+     * Adapt a Function to the UnaryFunction interface.
+     * @param function to adapt
+     * @return FunctionUnaryFunction
+     */
     public static FunctionUnaryFunction adapt(Function function) {
         return null == function ? null : new FunctionUnaryFunction(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/IgnoreLeftProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreLeftProcedure.java Mon Apr  7 16:29:25 2008
@@ -39,14 +39,27 @@
  * @author Rodney Waldhoff
  */
 public final class IgnoreLeftProcedure implements BinaryProcedure, Serializable {
+    /** The {@link UnaryProcedure UnaryProcedure} I'm wrapping. */
+    private UnaryProcedure procedure = null;
+
+    /**
+     * Create a new IgnoreLeftProcedure.
+     * @param procedure to adapt
+     */
     public IgnoreLeftProcedure(UnaryProcedure procedure) {
         this.procedure = procedure;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void run(Object left, Object right) {
         procedure.run(left);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof IgnoreLeftProcedure) {
             return equals((IgnoreLeftProcedure) that);
@@ -55,10 +68,18 @@
         }
     }
 
+    /**
+     * Learn whether another IgnoreLeftProcedure is equal to this.
+     * @param that IgnoreLeftProcedure to test
+     * @return boolean
+     */
     public boolean equals(IgnoreLeftProcedure that) {
         return that == this || (null != that && (null == procedure ? null == that.procedure : procedure.equals(that.procedure)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "IgnoreLeftProcedure".hashCode();
         if (null != procedure) {
@@ -67,14 +88,20 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "IgnoreLeftProcedure<" + procedure + ">";
     }
 
+    /**
+     * Adapt a UnaryProcedure to the BinaryProcedure interface.
+     * @param procedure to adapt
+     * @return IgnoreLeftProcedure
+     */
     public static IgnoreLeftProcedure adapt(UnaryProcedure procedure) {
         return null == procedure ? null : new IgnoreLeftProcedure(procedure);
     }
 
-    /** The {@link UnaryProcedure UnaryProcedure} I'm wrapping. */
-    private UnaryProcedure procedure = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/IgnoreRightProcedure.java Mon Apr  7 16:29:25 2008
@@ -39,14 +39,27 @@
  * @author Rodney Waldhoff
  */
 public final class IgnoreRightProcedure implements BinaryProcedure, Serializable {
+    /** The {@link UnaryProcedure UnaryProcedure} I'm wrapping. */
+    private UnaryProcedure procedure = null;
+
+    /**
+     * Create a new IgnoreRightProcedure.
+     * @param procedure UnaryProcedure to adapt
+     */
     public IgnoreRightProcedure(UnaryProcedure procedure) {
         this.procedure = procedure;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void run(Object left, Object right) {
         procedure.run(left);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof IgnoreRightProcedure) {
             return equals((IgnoreRightProcedure) that);
@@ -55,10 +68,19 @@
         }
     }
 
+    /**
+     * Learn whether another IgnoreRightProcedure is equal to this.
+     * @param that IgnoreRightProcedure to test
+     * @return boolean
+     */
     public boolean equals(IgnoreRightProcedure 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 = "IgnoreRightProcedure".hashCode();
         if (null != procedure) {
@@ -67,14 +89,20 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "IgnoreRightProcedure<" + procedure + ">";
     }
 
+    /**
+     * Adapt a UnaryProcedure to the BinaryProcedure interface.
+     * @param procedure UnaryProcedure to adapt
+     * @return IgnoreRightProcedure
+     */
     public static IgnoreRightProcedure adapt(UnaryProcedure procedure) {
         return null == procedure ? null : new IgnoreRightProcedure(procedure);
     }
 
-    /** The {@link UnaryProcedure UnaryProcedure} I'm wrapping. */
-    private UnaryProcedure procedure = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundPredicate.java Mon Apr  7 16:29:25 2008
@@ -39,7 +39,14 @@
  * @author Rodney Waldhoff
  */
 public final class LeftBoundPredicate 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 LeftBoundPredicate.
      * @param predicate the predicate to adapt
      * @param arg the constant argument to use
      */
@@ -48,10 +55,16 @@
         this.param = arg;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object obj) {
-        return predicate.test(param,obj);
+        return predicate.test(param, obj);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof LeftBoundPredicate) {
             return equals((LeftBoundPredicate) that);
@@ -60,14 +73,20 @@
         }
     }
 
+    /**
+     * Learn whether another LeftBoundPredicate is equal to this.
+     * @param that LeftBoundPredicate to test
+     * @return boolean
+     */
     public boolean equals(LeftBoundPredicate 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 = "LeftBoundPredicate".hashCode();
         if (null != predicate) {
@@ -81,16 +100,20 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "LeftBoundPredicate<" + predicate + "(" + param + ",?)>";
     }
 
+    /**
+     * Adapt a BinaryPredicate to the UnaryPredicate interface.
+     * @param predicate to adapt
+     * @param arg Object argument to always send as the left operand to the wrapped function 
+     * @return LeftBoundPredicate
+     */
     public static LeftBoundPredicate bind(BinaryPredicate predicate, Object arg) {
-        return null == predicate ? null : new LeftBoundPredicate(predicate,arg);
+        return null == predicate ? null : new LeftBoundPredicate(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/LeftBoundProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/LeftBoundProcedure.java Mon Apr  7 16:29:25 2008
@@ -39,7 +39,13 @@
  * @author Rodney Waldhoff
  */
 public final class LeftBoundProcedure implements UnaryProcedure, Serializable {
+    /** The {@link BinaryProcedure BinaryProcedure} I'm wrapping. */
+    private BinaryProcedure procedure = null;
+    /** The parameter to pass to that procedure. */
+    private Object param = null;
+
     /**
+     * Create a new LeftBoundProcedure.
      * @param procedure the procedure to adapt
      * @param arg the constant argument to use
      */
@@ -48,10 +54,16 @@
         this.param = arg;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void run(Object obj) {
-        procedure.run(param,obj);
+        procedure.run(param, obj);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof LeftBoundProcedure) {
             return equals((LeftBoundProcedure) that);
@@ -60,14 +72,21 @@
         }
     }
 
+    /**
+     * Learn whether another LeftBoundProcedure is equal to this.
+     * @param that LeftBoundProcedure to test
+     * @return boolean
+     */
     public boolean equals(LeftBoundProcedure that) {
-        return that == this || (
-                (null != that) &&
-                (null == procedure ? null == that.procedure : procedure.equals(that.procedure)) &&
-                (null == param ? null == that.param : param.equals(that.param)) );
+        return that == this || ((null != that)
+                && (null == procedure ? null == that.procedure : procedure.equals(that.procedure))
+                && (null == param ? null == that.param : param.equals(that.param)));
 
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "LeftBoundProcedure".hashCode();
         if (null != procedure) {
@@ -81,16 +100,21 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "LeftBoundProcedure<" + procedure + "(" + param + ",?)>";
     }
 
+    /**
+     * Get a UnaryProcedure from <code>procedure</code>.
+     * @param procedure to adapt
+     * @param arg left side argument
+     * @return LeftBoundProcedure
+     */
     public static LeftBoundProcedure bind(BinaryProcedure procedure, Object arg) {
         return null == procedure ? null : new LeftBoundProcedure(procedure,arg);
     }
 
-    /** The {@link BinaryProcedure BinaryProcedure} I'm wrapping. */
-    private BinaryProcedure procedure = null;
-    /** The parameter to pass to that procedure. */
-    private Object param = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/PredicateFunction.java Mon Apr  7 16:29:25 2008
@@ -38,11 +38,19 @@
  * @author Rodney Waldhoff
  */
 public final class PredicateFunction implements Function, Serializable {
+    /** The {@link Predicate Predicate} I'm wrapping. */
+    private Predicate predicate = null;
+
+    /**
+     * Create a new PredicateFunction.
+     * @param predicate to adapt
+     */
     public PredicateFunction(Predicate predicate) {
         this.predicate = predicate;
     }
 
     /**
+     * {@inheritDoc}
      * Returns <code>Boolean.TRUE</code> (<code>Boolean.FALSE</code>)
      * when the {@link Predicate#test test} method of my underlying
      * predicate returns <code>true</code> (<code>false</code>).
@@ -53,6 +61,9 @@
         return predicate.test() ? Boolean.TRUE : Boolean.FALSE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof PredicateFunction) {
             return equals((PredicateFunction) that);
@@ -61,10 +72,19 @@
         }
     }
 
+    /**
+     * Learn whether another PredicateFunction is equal to this.
+     * @param that PredicateFunction to test
+     * @return boolean
+     */
     public boolean equals(PredicateFunction that) {
-        return that == this || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+        return that == this
+                || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "PredicateFunction".hashCode();
         if (null != predicate) {
@@ -73,14 +93,20 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "PredicateFunction<" + predicate + ">";
     }
 
+    /**
+     * Adapt a Predicate to the Function interface.
+     * @param predicate to adapt
+     * @return PredicateFunction
+     */
     public static PredicateFunction adapt(Predicate predicate) {
         return null == predicate ? null : new PredicateFunction(predicate);
     }
 
-    /** The {@link Predicate Predicate} I'm wrapping. */
-    private Predicate predicate = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/ProcedureUnaryProcedure.java Mon Apr  7 16:29:25 2008
@@ -26,7 +26,7 @@
  * {@link Procedure Procedure}
  * to the
  * {@link UnaryProcedure UnaryProcedure} interface
- * by ignoring the second binary argument.
+ * by ignoring the arguments.
  * <p/>
  * Note that although this class implements
  * {@link Serializable}, a given instance will
@@ -39,14 +39,27 @@
  * @author Rodney Waldhoff
  */
 public final class ProcedureUnaryProcedure implements UnaryProcedure, Serializable {
+    /** The {@link Procedure Procedure} I'm wrapping. */
+    private Procedure procedure = null;
+
+    /**
+     * Create a new ProcedureUnaryProcedure.
+     * @param procedure to adapt
+     */
     public ProcedureUnaryProcedure(Procedure procedure) {
         this.procedure = procedure;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void run(Object obj) {
         procedure.run();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof ProcedureUnaryProcedure) {
             return equals((ProcedureUnaryProcedure) that);
@@ -55,10 +68,19 @@
         }
     }
 
+    /**
+     * Learn whether another ProcedureUnaryProcedure is equal to this.
+     * @param that ProcedureUnaryProcedure to test
+     * @return boolean
+     */
     public boolean equals(ProcedureUnaryProcedure 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 = "ProcedureUnaryProcedure".hashCode();
         if (null != procedure) {
@@ -67,14 +89,20 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "ProcedureUnaryProcedure<" + procedure + ">";
     }
 
+    /**
+     * Adapt a Procedure to the UnaryProcedure interface.
+     * @param procedure to adapt
+     * @return ProcedureUnaryProcedure
+     */
     public static ProcedureUnaryProcedure adapt(Procedure procedure) {
         return null == procedure ? null : new ProcedureUnaryProcedure(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/RightBoundFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/RightBoundFunction.java Mon Apr  7 16:29:25 2008
@@ -112,7 +112,7 @@
      * @return RightBoundFunction
      */
     public static RightBoundFunction bind(BinaryFunction function, Object arg) {
-        return null == function ? null : new RightBoundFunction(function,arg);
+        return null == function ? null : new RightBoundFunction(function, arg);
     }
 
 }

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

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/adapter/UnaryPredicateUnaryFunction.java Mon Apr  7 16:29:25 2008
@@ -38,11 +38,19 @@
  * @author Rodney Waldhoff
  */
 public final class UnaryPredicateUnaryFunction implements UnaryFunction, Serializable {
+    /** The {@link UnaryPredicate UnaryPredicate} I'm wrapping. */
+    private UnaryPredicate predicate = null;
+
+    /**
+     * Create a new UnaryPredicateUnaryFunction.
+     * @param predicate to adapt
+     */
     public UnaryPredicateUnaryFunction(UnaryPredicate predicate) {
         this.predicate = predicate;
     }
 
     /**
+     * {@inheritDoc}
      * Returns <code>Boolean.TRUE</code> (<code>Boolean.FALSE</code>)
      * when the {@link UnaryPredicate#test test} method of my underlying
      * predicate returns <code>true</code> (<code>false</code>).
@@ -53,6 +61,9 @@
         return predicate.test(obj) ? Boolean.TRUE : Boolean.FALSE;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof UnaryPredicateUnaryFunction) {
             return equals((UnaryPredicateUnaryFunction) that);
@@ -61,10 +72,19 @@
         }
     }
 
+    /**
+     * Learn whether another UnaryPredicateUnaryFunction is equal to this.
+     * @param that UnaryPredicateUnaryFunction to test
+     * @return boolean
+     */
     public boolean equals(UnaryPredicateUnaryFunction that) {
-        return that == this || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
+        return that == this
+                || (null != that && (null == predicate ? null == that.predicate : predicate.equals(that.predicate)));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "UnaryPredicateUnaryFunction".hashCode();
         if (null != predicate) {
@@ -73,14 +93,20 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "UnaryPredicateUnaryFunction<" + predicate + ">";
     }
 
+    /**
+     * Adapt a UnaryPredicate to the UnaryFunction interface.
+     * @param predicate to adapt
+     * @return UnaryPredicateUnaryFunction
+     */
     public static UnaryPredicateUnaryFunction adapt(UnaryPredicate predicate) {
         return null == predicate ? null : new UnaryPredicateUnaryFunction(predicate);
     }
 
-    /** The {@link UnaryPredicate UnaryPredicate} I'm wrapping. */
-    private UnaryPredicate predicate = null;
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsEqual.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsEqual.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsEqual.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsEqual.java Mon Apr  7 16:29:25 2008
@@ -36,39 +36,56 @@
  * @author Rodney Waldhoff
  */
 public final class IsEqual implements BinaryPredicate, Serializable {
+    // static attributes
+    // ------------------------------------------------------------------------
+    private static final IsEqual INSTANCE = new IsEqual();
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new IsEqual.
+     */
     public IsEqual() {
     }
 
     // predicate interface
     // ------------------------------------------------------------------------
-
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object left, Object right) {
         return (null == left ? null == right : left.equals(right));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         return that instanceof IsEqual;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         return "IsEqual".hashCode();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "IsEqual";
     }
 
     // static methods
     // ------------------------------------------------------------------------
+    /**
+     * Get an IsEqual instance.
+     * @return IsEqual
+     */
     public static IsEqual instance() {
         return INSTANCE;
     }
-
-    // static attributes
-    // ------------------------------------------------------------------------
-    private static final IsEqual INSTANCE = new IsEqual();
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotEqual.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotEqual.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotEqual.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotEqual.java Mon Apr  7 16:29:25 2008
@@ -33,39 +33,56 @@
  * @author Rodney Waldhoff
  */
 public final class IsNotEqual implements BinaryPredicate, Serializable {
+    // static attributes
+    // ------------------------------------------------------------------------
+    private static final IsNotEqual INSTANCE = new IsNotEqual();
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new IsNotEqual.
+     */
     public IsNotEqual() {
     }
 
     // predicate interface
     // ------------------------------------------------------------------------
-
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object left, Object right) {
         return (null == left ? null != right : !left.equals(right));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         return that instanceof IsNotEqual;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         return "IsNotEqual".hashCode();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "IsNotEqual";
     }
 
     // static methods
     // ------------------------------------------------------------------------
+    /**
+     * Get an IsNotEqual instance.
+     * @return IsNotEqual
+     */
     public static IsNotEqual instance() {
         return INSTANCE;
     }
-
-    // static attributes
-    // ------------------------------------------------------------------------
-    private static final IsNotEqual INSTANCE = new IsNotEqual();
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotNull.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotNull.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotNull.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/IsNotNull.java Mon Apr  7 16:29:25 2008
@@ -29,39 +29,56 @@
  * @author Rodney Waldhoff
  */
 public final class IsNotNull implements UnaryPredicate, Serializable {
+    // static attributes
+    // ------------------------------------------------------------------------
+    private static final IsNotNull INSTANCE = new IsNotNull();
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new IsNotNull.
+     */
     public IsNotNull() {
     }
 
     // predicate interface
     // ------------------------------------------------------------------------
-
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object obj) {
         return (null != obj);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         return that instanceof IsNotNull;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         return "IsNotNull".hashCode();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "IsNotNull";
     }
 
     // static methods
     // ------------------------------------------------------------------------
+    /**
+     * Get an IsNotNull instance.
+     * @return IsNotNull
+     */
     public static IsNotNull instance() {
         return INSTANCE;
     }
-
-    // static attributes
-    // ------------------------------------------------------------------------
-    private static final IsNotNull INSTANCE = new IsNotNull();
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/LeftIdentity.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/LeftIdentity.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/LeftIdentity.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/LeftIdentity.java Mon Apr  7 16:29:25 2008
@@ -34,46 +34,72 @@
  * @author Rodney Waldhoff
  */
 public final class LeftIdentity implements BinaryPredicate, BinaryFunction, Serializable {
+    // static attributes
+    // ------------------------------------------------------------------------
+    private static final LeftIdentity INSTANCE = new LeftIdentity();
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new LeftIdentity.
+     */
     public LeftIdentity() {
     }
 
     // functor interface
     // ------------------------------------------------------------------------
-
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object left, Object right) {
         return left;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object left, Object right) {
         return test((Boolean) left);
     }
 
+    /**
+     * 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 LeftIdentity);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         return "LeftIdentity".hashCode();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "LeftIdentity";
     }
 
     // static methods
     // ------------------------------------------------------------------------
+    /**
+     * Get a LeftIdentity instance.
+     * @return LeftIdentity
+     */
     public static LeftIdentity instance() {
         return INSTANCE;
     }
 
-    // static attributes
-    // ------------------------------------------------------------------------
-    private static final LeftIdentity INSTANCE = new LeftIdentity();
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java Mon Apr  7 16:29:25 2008
@@ -32,42 +32,67 @@
  * @author Rodney Waldhoff
  */
 public final class NoOp implements Procedure, UnaryProcedure, BinaryProcedure, Serializable {
+    // static attributes
+    // ------------------------------------------------------------------------
+    private static final NoOp INSTANCE = new NoOp();
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new NoOp.
+     */
     public NoOp() {
     }
 
     // predicate interface
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public void run() {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void run(Object obj) {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void run(Object left, Object right) {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         return (that instanceof NoOp);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         return "NoOp".hashCode();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "NoOp";
     }
 
     // static methods
     // ------------------------------------------------------------------------
+    /**
+     * Get a NoOp instance.
+     * @return NoOp
+     */
     public static NoOp instance() {
         return INSTANCE;
     }
 
-    // static attributes
-    // ------------------------------------------------------------------------
-    private static final NoOp INSTANCE = new NoOp();
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/Offset.java Mon Apr  7 16:29:25 2008
@@ -32,7 +32,15 @@
  */
 
 public final class Offset implements Predicate, UnaryPredicate, BinaryPredicate {
+    // instance variables
+    //---------------------------------------------------------------
+    private int min;
+    private int current = 0;
 
+    /**
+     * Create a new Offset.
+     * @param count offset
+     */
     public Offset(int count) {
         if (count < 0) {
             throw new IllegalArgumentException("Argument must be a non-negative integer.");
@@ -40,8 +48,11 @@
         this.min = count;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test() {
-        // stop incremeting when we've hit max, so we don't loop around
+        // stop incrementing when we've hit max, so we don't loop around
         if (current < min) {
             current++;
             return false;
@@ -50,20 +61,25 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object obj) {
         return test();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean test(Object a, Object b) {
         return test();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "Offset<" + min + ">";
     }
-    // instance variables
-    //---------------------------------------------------------------
-    private int min;
-    private int current = 0;
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/FilteredIterator.java Mon Apr  7 16:29:25 2008
@@ -26,10 +26,22 @@
  * @author Rodney Waldhoff
  */
 public final class FilteredIterator implements Iterator {
+    // attributes
+    // ------------------------------------------------------------------------
+
+    private UnaryPredicate predicate = null;
+    private Iterator iterator = null;
+    private Object next = null;
+    private boolean nextSet = false;
+    private boolean canRemove = false;
 
     // constructor
     // ------------------------------------------------------------------------
-
+    /**
+     * Create a new FilteredIterator.
+     * @param iterator to filter
+     * @param predicate to apply
+     */
     public FilteredIterator(Iterator iterator, UnaryPredicate predicate) {
         if (null == iterator || null == predicate) {
             throw new NullPointerException();
@@ -43,6 +55,7 @@
     // ------------------------------------------------------------------------
 
     /**
+     * {@inheritDoc}
      * @see java.util.Iterator#hasNext()
      */
     public boolean hasNext() {
@@ -54,6 +67,7 @@
     }
 
     /**
+     * {@inheritDoc}
      * @see java.util.Iterator#next()
      */
     public Object next() {
@@ -65,6 +79,7 @@
     }
 
     /**
+     * {@inheritDoc}
      * @see java.util.Iterator#remove()
      */
     public void remove() {
@@ -76,7 +91,9 @@
         }
     }
 
-
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object obj) {
         if (obj instanceof FilteredIterator) {
             FilteredIterator that = (FilteredIterator) obj;
@@ -86,6 +103,9 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "FilteredIterator".hashCode();
         hash <<= 2;
@@ -95,27 +115,38 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "FilteredIterator<" + iterator + "," + predicate + ">";
     }
 
-    // class methods
+    // static methods
     // ------------------------------------------------------------------------
-
+    /**
+     * Get a filtered Iterator instance applying <code>pred</code> to <code>iter</code>.
+     * @param iter to filter
+     * @param pred to apply
+     * @return Iterator
+     */
     public static Iterator filter(Iterator iter, UnaryPredicate pred) {
-        return null == pred ? iter : (null == iter ? null : new FilteredIterator(iter,pred));
+        return null == pred ? iter : (null == iter ? null : new FilteredIterator(iter, pred));
     }
 
     // private
     // ------------------------------------------------------------------------
-
+    /**
+     * Set next element.
+     * @return whether the current iterator position is valid
+     */
     private boolean setNext() {
         while(iterator.hasNext()) {
             canRemove = false;
             Object obj = iterator.next();
             if (predicate.test(obj)) {
-                next = obj;
                 nextSet = true;
+                next = obj;
                 return true;
             }
         }
@@ -124,6 +155,10 @@
         return false;
     }
 
+    /**
+     * Get the next element.
+     * @return next element.
+     */
     private Object returnNext() {
         Object temp = next;
         canRemove = true;
@@ -131,15 +166,5 @@
         nextSet = false;
         return temp;
     }
-
-    // attributes
-    // ------------------------------------------------------------------------
-
-    private UnaryPredicate predicate = null;
-    private Iterator iterator = null;
-    private Object next = null;
-    private boolean nextSet = false;
-    private boolean canRemove = false;
-
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/collection/TransformedIterator.java Mon Apr  7 16:29:25 2008
@@ -26,9 +26,19 @@
  */
 public final class TransformedIterator implements Iterator {
 
-    // constructor
+    // attributes
     // ------------------------------------------------------------------------
 
+    private UnaryFunction function = null;
+    private Iterator iterator = null;
+
+    // constructor
+    // ------------------------------------------------------------------------
+    /**
+     * Create a new TransformedIterator.
+     * @param iterator Iterator to decorate
+     * @param function to apply
+     */
     public TransformedIterator(Iterator iterator, UnaryFunction function) {
         if (null == iterator || null == function) {
             throw new NullPointerException();
@@ -42,6 +52,7 @@
     // ------------------------------------------------------------------------
 
     /**
+     * {@inheritDoc}
      * @see java.util.Iterator#hasNext()
      */
     public boolean hasNext() {
@@ -49,6 +60,7 @@
     }
 
     /**
+     * {@inheritDoc}
      * @see java.util.Iterator#next()
      */
     public Object next() {
@@ -56,12 +68,16 @@
     }
 
     /**
+     * {@inheritDoc}
      * @see java.util.Iterator#remove()
      */
     public void remove() {
         iterator.remove();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object obj) {
         if (obj instanceof TransformedIterator) {
             TransformedIterator that = (TransformedIterator) obj;
@@ -71,6 +87,9 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "TransformedIterator".hashCode();
         hash <<= 2;
@@ -80,23 +99,24 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "TransformedIterator<" + iterator + "," + function + ">";
     }
 
     // class methods
     // ------------------------------------------------------------------------
-
+    /**
+     * Get a TransformedIterator instance.
+     * @param iter to decorate
+     * @param func transforming function
+     * @return Iterator
+     */
+    //TODO is this the best name for this method?
     public static Iterator transform(Iterator iter, UnaryFunction func) {
         return null == func ? iter : (null == iter ? null : new TransformedIterator(iter,func));
     }
-
-
-    // attributes
-    // ------------------------------------------------------------------------
-
-    private UnaryFunction function = null;
-    private Iterator iterator = null;
-
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java Mon Apr  7 16:29:25 2008
@@ -27,41 +27,49 @@
  * @author Rodney Waldhoff
  */
 final class ComparableComparator implements Comparator, Serializable {
+    /** Singleton */
+    public static final ComparableComparator INSTANCE = new ComparableComparator();
+
+    /**
+     * Create a new ComparableComparator.
+     */
     public ComparableComparator() {
     }
 
     /**
-     * @see java.util.Comparator#compare(Object, Object)
+     * {@inheritDoc}
      */
     public int compare(Object o1, Object o2) {
         return ((Comparable) o1).compareTo(o2);
     }
 
     /**
-     * @see java.lang.Object#equals(Object)
+     * {@inheritDoc}
      */
     public boolean equals(Object obj) {
         return (obj instanceof ComparableComparator);
     }
 
     /**
-     * @see java.lang.Object#hashCode()
+     * {@inheritDoc}
      */
     public int hashCode() {
         return toString().hashCode();
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * {@inheritDoc}
      */
     public String toString() {
         return" ComparableComparator";
     }
 
+    /**
+     * Get a ComparableComparator instance.
+     * @return ComparableComparator
+     */
     public static final ComparableComparator instance() {
         return INSTANCE;
     }
-
-    public static final ComparableComparator INSTANCE = new ComparableComparator();
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java Mon Apr  7 16:29:25 2008
@@ -37,6 +37,9 @@
  *
  */
 public final class IsNotEquivalent implements BinaryPredicate, Serializable {
+    private static final IsNotEquivalent COMPARABLE_INSTANCE = new IsNotEquivalent();
+
+    private Comparator comparator = null;
     /**
      * Construct a <code>IsNotEquivalent</code> {@link BinaryPredicate predicate}
      * for {@link Comparable Comparable}s.
@@ -58,16 +61,17 @@
     }
 
     /**
+     * {@inheritDoc}
      * Return <code>true</code> iff the <i>left</i> parameter is
      * not equal to the <i>right</i> parameter under my current
      * {@link Comparator Comparator}.
      */
     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 IsNotEquivalent) {
@@ -78,15 +82,16 @@
     }
 
     /**
-     * @see #equals(Object)
+     * Learn whether another IsNotEquivalent is equal to this.
+     * @param that IsNotEquivalent to test
+     * @return boolean
      */
     public boolean equals(IsNotEquivalent 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 = "IsNotEquivalent".hashCode();
@@ -96,20 +101,27 @@
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * {@inheritDoc}
      */
     public String toString() {
         return "IsNotEquivalent<" + comparator + ">";
     }
 
+    /**
+     * Get an IsNotEquivalent instance.
+     * @return IsNotEquivalent
+     */
     public static final IsNotEquivalent instance() {
         return COMPARABLE_INSTANCE;
     }
 
+    /**
+     * Get an IsNotEquivalent UnaryPredicate.
+     * @param right Comparable against which UnaryPredicate arguments will be compared.
+     * @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 IsNotEquivalent COMPARABLE_INSTANCE = new IsNotEquivalent();
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsWithinRange.java Mon Apr  7 16:29:25 2008
@@ -46,8 +46,10 @@
      ***************************************************/
 
     /**
-     * Constructor the object by passing in the range that will
+     * Create a new IsWithinRange by passing in the range that will
      * be used in the {@link #test}.
+     * @param min Comparable
+     * @param max Comparable
      */
     public IsWithinRange(Comparable min, Comparable max) {
         if (min == null || max == null) {
@@ -67,6 +69,7 @@
      ***************************************************/
 
     /**
+     * {@inheritDoc}
      * Test if the passed in object is within the specified range.
      */
     public boolean test(Object o) {
@@ -74,19 +77,36 @@
         return c.compareTo(min) >= 0 && c.compareTo(max) <= 0;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object o) {
-        if (this == o) return true;
-        if (!(o instanceof IsWithinRange)) return false;
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof IsWithinRange)) {
+            return false;
+        }
         final IsWithinRange isWithinRange = (IsWithinRange) o;
-        if (!max.equals(isWithinRange.max)) return false;
-        if (!min.equals(isWithinRange.min)) return false;
+        if (!max.equals(isWithinRange.max)) {
+            return false;
+        }
+        if (!min.equals(isWithinRange.min)) {
+            return false;
+        }
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         return 29 * min.hashCode() + max.hashCode() + nameHashCode;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "IsBetween(" + min + ", " + max + ")";
     }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java Mon Apr  7 16:29:25 2008
@@ -29,23 +29,33 @@
  * @author Rodney Waldhoff
  */
 public final class Max implements BinaryFunction, Serializable {
+    private Comparator comparator = null;
+    private static final Max INSTANCE = new Max();
+
+    /**
+     * Create a new Max.
+     */
     public Max() {
         this(null);
     }
 
+    /**
+     * Create a new Max.
+     * @param comparator Comparator to use
+     */
     public Max(Comparator comparator) {
         this.comparator = null == comparator ? ComparableComparator.instance() : comparator;
     }
 
     /**
-     * @see org.apache.commons.functor.BinaryFunction#evaluate(Object, Object)
+     * {@inheritDoc}
      */
     public Object evaluate(Object left, Object right) {
         return (comparator.compare(left,right) >= 0) ? left : right;
     }
 
     /**
-     * @see java.lang.Object#equals(Object)
+     * {@inheritDoc}
      */
     public boolean equals(Object that) {
         if (that instanceof Max) {
@@ -56,30 +66,34 @@
     }
 
     /**
-     * @see #equals(Object)
+     * Learn whether another Max is equal to this.
+     * @param that Max to test
+     * @return boolean
      */
     public boolean equals(Max that) {
         return null != that && comparator.equals(that.comparator);
     }
 
     /**
-     * @see java.lang.Object#hashCode()
+     * {@inheritDoc}
      */
     public int hashCode() {
         return "Max".hashCode() ^ comparator.hashCode();
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * {@inheritDoc}
      */
     public String toString() {
         return "Max<" + comparator + ">";
     }
 
+    /**
+     * Get a Max instance.
+     * @return Max
+     */
     public static Max instance() {
         return INSTANCE;
     }
 
-    private Comparator comparator = null;
-    private static final Max INSTANCE = new Max();
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java Mon Apr  7 16:29:25 2008
@@ -29,8 +29,9 @@
  * @author Rodney Waldhoff
  */
 public final class Min implements BinaryFunction, Serializable {
-    private Comparator comparator = null;
     private static final Min INSTANCE = new Min();
+
+    private Comparator comparator = null;
 
     /**
      * Create a new Min.

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/AbstractLoopProcedure.java Mon Apr  7 16:29:25 2008
@@ -21,7 +21,6 @@
 
 import java.io.Serializable;
 
-
 /**
  * Abstract base class for {@link WhileDoProcedure} and {@link DoWhileProcedure}
  * used to implement loop procedures.
@@ -31,50 +30,77 @@
  * @author Rodney Waldhoff
  */
 public abstract class AbstractLoopProcedure implements Procedure, Serializable {
+    private Predicate condition;
+    private Procedure action;
+
+    /**
+     * Create a new AbstractLoopProcedure.
+     * @param condition while true, repeat
+     * @param action loop body
+     */
     protected AbstractLoopProcedure(Predicate condition, Procedure action) {
-        this.condition=condition;
-        this.action=action;
+        this.condition = condition;
+        this.action = action;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals(Object object) {
+        if (object instanceof AbstractLoopProcedure) {
+            AbstractLoopProcedure that = (AbstractLoopProcedure) object;
+            return (null == getCondition() ? null == that.getCondition() : getCondition().equals(that.getCondition()))
+                    && (null == getAction() ? null == that.getAction() : getAction().equals(that.getAction()));
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int hashCode() {
+        return hashCode("AbstractLoopProcedure".hashCode());
     }
 
-	public boolean equals(Object object) {
-		if (object instanceof AbstractLoopProcedure) {
-			AbstractLoopProcedure that = (AbstractLoopProcedure) object;
-			return (null == getCondition() ? null == that.getCondition() : getCondition().equals(that.getCondition())) &&
-				(null == getAction() ? null == that.getAction() : getAction().equals(that.getAction()));
-		} else {
-			return false;
-		}
-	}
-
-	public int hashCode() {
-		return hashCode("AbstractLoopProcedure".hashCode());
-	}
-
-	public String toString() {
-		return getClass().getName() + "<" + getCondition() + "," + getAction() + ">";
-	}
-	protected int hashCode(int hash) {
-		hash <<= 4;
-		if (null != getAction()) {
-			hash ^= getAction().hashCode();
-		}
-		hash <<= 4;
-		if (null != getCondition()) {
-			hash ^= getCondition().hashCode();
-		}
-		return hash;
-	}
-
-
-	protected Predicate getCondition() {
-		return condition;
-	}
-
-	protected Procedure getAction() {
-		return action;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    public String toString() {
+        return getClass().getName() + "<" + getCondition() + "," + getAction() + ">";
+    }
+
+    /**
+     * Create a hashCode by manipulating an input hashCode and factoring in instance state.
+     * @param hash incoming hashCode
+     * @return int
+     */
+    protected int hashCode(int hash) {
+        hash <<= 4;
+        if (null != getAction()) {
+            hash ^= getAction().hashCode();
+        }
+        hash <<= 4;
+        if (null != getCondition()) {
+            hash ^= getCondition().hashCode();
+        }
+        return hash;
+    }
 
-	private Predicate condition;
-	private Procedure action;
+    /**
+     * Get the condition.
+     * @return Predicate
+     */
+    protected Predicate getCondition() {
+        return condition;
+    }
+
+    /**
+     * Get the action.
+     * @return Procedure
+     */
+    protected Procedure getAction() {
+        return action;
+    }
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BasePredicateList.java Mon Apr  7 16:29:25 2008
@@ -38,21 +38,42 @@
  * @author Rodney Waldhoff
  */
 abstract class BasePredicateList implements Predicate, Serializable {
+    // attributes
+    // ------------------------------------------------------------------------
+    private List list = new ArrayList();
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new BasePredicateList.
+     */
     protected BasePredicateList() {
     }
 
+    /**
+     * Create a new BasePredicateList.
+     * @param p Predicate to add
+     */
     protected BasePredicateList(Predicate p) {
         addPredicate(p);
     }
 
+    /**
+     * Create a new BasePredicateList.
+     * @param p Predicate to add
+     * @param q Predicate to add
+     */
     protected BasePredicateList(Predicate p, Predicate q) {
         addPredicate(p);
         addPredicate(q);
     }
 
+    /**
+     * Create a new BasePredicateList.
+     * @param p Predicate to add
+     * @param q Predicate to add
+     * @param r Predicate to add
+     */
     protected BasePredicateList(Predicate p, Predicate q, Predicate r) {
         addPredicate(p);
         addPredicate(q);
@@ -61,38 +82,69 @@
 
     // abstract
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public abstract boolean equals(Object that);
+
+    /**
+     * {@inheritDoc}
+     */
     public abstract int hashCode();
+
+    /**
+     * {@inheritDoc}
+     */
     public abstract String toString();
+
+    /**
+     * {@inheritDoc}
+     */
     public abstract boolean test();
 
     // modifiers
     // ------------------------------------------------------------------------
+    /**
+     * Add a Predicate to the list.
+     * @param p Predicate to add
+     */
     protected void addPredicate(Predicate p) {
         list.add(p);
     }
 
     // protected
     // ------------------------------------------------------------------------
-
+    /**
+     * Get an Iterator over the contents of the list.
+     * @return Iterator<Predicate>
+     */
     protected Iterator getPredicateIterator() {
         return list.iterator();
     }
 
+    /**
+     * Learn whether the list of another BasePredicateList is equal to my list.
+     * @param that BasePredicateList to test
+     * @return boolean
+     */
     protected boolean getPredicateListEquals(BasePredicateList that) {
         return (null != that && this.list.equals(that.list));
     }
 
+    /**
+     * Get a hashCode for my list.
+     * @return int
+     */
     protected int getPredicateListHashCode() {
         return list.hashCode();
     }
 
+    /**
+     * Get a toString for my list.
+     * @return String
+     */
     protected String getPredicateListToString() {
         return String.valueOf(list);
     }
-
-    // attributes
-    // ------------------------------------------------------------------------
-    private List list = new ArrayList();
 
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java?rev=645735&r1=645734&r2=645735&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java Mon Apr  7 16:29:25 2008
@@ -37,9 +37,20 @@
  * @author Rodney Waldhoff
  */
 public class BinaryCompositeBinaryFunction implements BinaryFunction, Serializable {
+    // attributes
+    // ------------------------------------------------------------------------
+    private BinaryFunction binary = null;
+    private BinaryFunction leftBinary = null;
+    private BinaryFunction rightBinary = null;
 
     // constructor
     // ------------------------------------------------------------------------
+    /**
+     * Create a new BinaryCompositeBinaryFunction.
+     * @param f function
+     * @param g function
+     * @param h function
+     */
     public BinaryCompositeBinaryFunction(BinaryFunction f, BinaryFunction g, BinaryFunction h) {
         binary = f;
         leftBinary = g;
@@ -48,10 +59,16 @@
 
     // function interface
     // ------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
     public Object evaluate(Object left, Object right) {
-        return binary.evaluate(leftBinary.evaluate(left,right), rightBinary.evaluate(left,right));
+        return binary.evaluate(leftBinary.evaluate(left, right), rightBinary.evaluate(left, right));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean equals(Object that) {
         if (that instanceof BinaryCompositeBinaryFunction) {
             return equals((BinaryCompositeBinaryFunction) that);
@@ -60,13 +77,21 @@
         }
     }
 
+    /**
+     * Learn whether another BinaryCompositeBinaryFunction is equal to this.
+     * @param that BinaryCompositeBinaryFunction to test
+     * @return boolean
+     */
     public boolean equals(BinaryCompositeBinaryFunction that) {
-        return (null != that) &&
-            (null == binary ? null == that.binary : binary.equals(that.binary)) &&
-            (null == leftBinary ? null == that.leftBinary : leftBinary.equals(that.leftBinary)) &&
-            (null == rightBinary ? null == that.rightBinary : rightBinary.equals(that.rightBinary));
+        return (null != that)
+                && (null == binary ? null == that.binary : binary.equals(that.binary))
+                && (null == leftBinary ? null == that.leftBinary : leftBinary.equals(that.leftBinary))
+                && (null == rightBinary ? null == that.rightBinary : rightBinary.equals(that.rightBinary));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int hashCode() {
         int hash = "BinaryCompositeBinaryFunction".hashCode();
         if (null != binary) {
@@ -84,14 +109,11 @@
         return hash;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "BinaryCompositeBinaryFunction<" + binary + ";" + leftBinary + ";" + rightBinary + ">";
     }
-
-    // attributes
-    // ------------------------------------------------------------------------
-    private BinaryFunction binary = null;
-    private BinaryFunction leftBinary = null;
-    private BinaryFunction rightBinary = null;
 
 }



Mime
View raw message