commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r665761 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/
Date Mon, 09 Jun 2008 16:50:57 GMT
Author: mbenson
Date: Mon Jun  9 09:50:56 2008
New Revision: 665761

URL: http://svn.apache.org/viewvc?rev=665761&view=rev
Log:
generify base interfaces

Modified:
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryProcedure.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Function.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunction.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryPredicate.java
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryProcedure.java

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunction.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunction.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunction.java
Mon Jun  9 09:50:56 2008
@@ -26,13 +26,13 @@
  * @version $Revision$ $Date$
  * @author Rodney Waldhoff
  */
-public interface BinaryFunction extends BinaryFunctor {
+public interface BinaryFunction<L, R, T> extends BinaryFunctor<L, R> {
     /**
      * Evaluate this function.
      *
-     * @param left the first element of the ordered pair of arguments
-     * @param right the second element of the ordered pair of arguments
-     * @return the result of this function for the given arguments
+     * @param left the L element of the ordered pair of arguments
+     * @param right the R element of the ordered pair of arguments
+     * @return the T result of this function for the given arguments
      */
-    Object evaluate(Object left, Object right);
+    T evaluate(L left, R right);
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java
Mon Jun  9 09:50:56 2008
@@ -26,5 +26,5 @@
  * @since 1.0
  * @version $Revision$ $Date$
  */
-public interface BinaryFunctor extends Functor {
+public interface BinaryFunctor<L, R> extends Functor {
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryPredicate.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryPredicate.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryPredicate.java
Mon Jun  9 09:50:56 2008
@@ -27,13 +27,13 @@
  * @version $Revision$ $Date$
  * @author Rodney Waldhoff
  */
-public interface BinaryPredicate extends BinaryFunctor {
+public interface BinaryPredicate<L, R> extends BinaryFunctor<L, R> {
     /**
      * Evaluate this predicate.
      *
-     * @param left the first element of the ordered pair of arguments
-     * @param right the second element of the ordered pair of arguments
+     * @param left the L element of the ordered pair of arguments
+     * @param right the R element of the ordered pair of arguments
      * @return the result of this test for the given arguments
      */
-    boolean test(Object left, Object right);
+    boolean test(L left, R right);
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryProcedure.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryProcedure.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryProcedure.java
Mon Jun  9 09:50:56 2008
@@ -27,12 +27,12 @@
  * @version $Revision$ $Date$
  * @author Rodney Waldhoff
  */
-public interface BinaryProcedure extends BinaryFunctor {
+public interface BinaryProcedure<L, R> extends BinaryFunctor<L, R> {
     /**
      * Execute this procedure.
      *
-     * @param left the first element of the ordered pair of arguments
-     * @param right the second element of the ordered pair of arguments
+     * @param left the L element of the ordered pair of arguments
+     * @param right the R element of the ordered pair of arguments
      */
-    void run(Object left, Object right);
+    void run(L left, R right);
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Function.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Function.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Function.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Function.java Mon
Jun  9 09:50:56 2008
@@ -27,10 +27,10 @@
  * @version $Revision$ $Date$
  * @author Rodney Waldhoff
  */
-public interface Function extends NullaryFunctor {
+public interface Function<T> extends NullaryFunctor {
     /**
      * Evaluate this function.
-     * @return the result of this evaluation
+     * @return the T result of this evaluation
      */
-    Object evaluate();
+    T evaluate();
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunction.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunction.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunction.java
Mon Jun  9 09:50:56 2008
@@ -27,12 +27,12 @@
  * @version $Revision$ $Date$
  * @author Rodney Waldhoff
  */
-public interface UnaryFunction extends UnaryFunctor {
+public interface UnaryFunction<A, T> extends UnaryFunctor<A> {
     /**
      * Evaluate this function.
      *
-     * @param obj the object to evaluate
-     * @return the result of this evaluation
+     * @param obj the A object to evaluate
+     * @return the T result of this evaluation
      */
-    Object evaluate(Object obj);
+    T evaluate(A obj);
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java
Mon Jun  9 09:50:56 2008
@@ -26,5 +26,5 @@
  * @since 1.0
  * @version $Revision$ $Date$
  */
-public interface UnaryFunctor extends Functor {
+public interface UnaryFunctor<A> extends Functor {
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryPredicate.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryPredicate.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryPredicate.java
Mon Jun  9 09:50:56 2008
@@ -27,12 +27,12 @@
  * @version $Revision$ $Date$
  * @author Rodney Waldhoff
  */
-public interface UnaryPredicate extends UnaryFunctor {
+public interface UnaryPredicate<A> extends UnaryFunctor<A> {
     /**
      * Evaluate this predicate.
      *
-     * @param obj the object to test
+     * @param obj the A object to test
      * @return the result of this test
      */
-    boolean test(Object obj);
+    boolean test(A obj);
 }

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryProcedure.java?rev=665761&r1=665760&r2=665761&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryProcedure.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryProcedure.java
Mon Jun  9 09:50:56 2008
@@ -27,10 +27,10 @@
  * @version $Revision$ $Date$
  * @author Rodney Waldhoff
  */
-public interface UnaryProcedure extends UnaryFunctor {
+public interface UnaryProcedure<A> extends UnaryFunctor<A> {
     /**
      * Execute this procedure.
-     * @param obj a parameter to this execution
+     * @param obj an A parameter to this execution
      */
-    void run(Object obj);
+    void run(A obj);
 }



Mime
View raw message