You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2008/04/11 22:08:57 UTC
svn commit: r647290 -
/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/
Author: mbenson
Date: Fri Apr 11 13:08:44 2008
New Revision: 647290
URL: http://svn.apache.org/viewvc?rev=647290&view=rev
Log:
[SANDBOX-224] functor parent interface(s)
Added:
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java (with props)
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Functor.java (with props)
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/NullaryFunctor.java (with props)
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java (with props)
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/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/Predicate.java
commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Procedure.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/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=647290&r1=647289&r2=647290&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 Fri Apr 11 13:08:44 2008
@@ -26,7 +26,7 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface BinaryFunction {
+public interface BinaryFunction extends BinaryFunctor {
/**
* Evaluate this function.
*
@@ -35,49 +35,4 @@
* @return the result of this function for the given arguments
*/
Object evaluate(Object left, Object right);
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}
Added: 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=647290&view=auto
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java (added)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java Fri Apr 11 13:08:44 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.functor;
+
+/**
+ * Marker interface for binary (two-argument) functors.
+ * <p>
+ * Implementors are encouraged but not required to make their functors
+ * {@link java.io.Serializable Serializable}.
+ * </p>
+ *
+ * @since 1.0
+ * @version $Revision$ $Date$
+ */
+public interface BinaryFunctor extends Functor {
+}
Propchange: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/BinaryFunctor.java
------------------------------------------------------------------------------
svn:eol-style = native
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=647290&r1=647289&r2=647290&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 Fri Apr 11 13:08:44 2008
@@ -27,7 +27,7 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface BinaryPredicate {
+public interface BinaryPredicate extends BinaryFunctor {
/**
* Evaluate this predicate.
*
@@ -36,49 +36,4 @@
* @return the result of this test for the given arguments
*/
boolean test(Object left, Object right);
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}
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=647290&r1=647289&r2=647290&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 Fri Apr 11 13:08:44 2008
@@ -27,7 +27,7 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface BinaryProcedure {
+public interface BinaryProcedure extends BinaryFunctor {
/**
* Execute this procedure.
*
@@ -35,49 +35,4 @@
* @param right the second element of the ordered pair of arguments
*/
void run(Object left, Object right);
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}
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=647290&r1=647289&r2=647290&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 Fri Apr 11 13:08:44 2008
@@ -27,55 +27,10 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface Function {
+public interface Function extends NullaryFunctor {
/**
* Evaluate this function.
* @return the result of this evaluation
*/
Object evaluate();
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}
Added: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Functor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Functor.java?rev=647290&view=auto
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Functor.java (added)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Functor.java Fri Apr 11 13:08:44 2008
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.functor;
+
+/**
+ * Functor marker interface. All provided functor interfaces extend this interface.
+ * <p>
+ * Implementors are encouraged but not required to make their functors
+ * {@link java.io.Serializable Serializable}.
+ * </p>
+ *
+ * @since 1.0
+ * @version $Revision$ $Date$
+ */
+public interface Functor {
+
+ /**
+ * Returns a human readable description of this functor.
+ * Implementators are strongly encouraged but not
+ * strictly required to override the default {@link Object}
+ * implementation of this method.
+ *
+ * @return a human readable description of this functor
+ */
+ String toString();
+
+ /**
+ * Returns a hash code for this functor adhering to the
+ * general {@link Object#hashCode Object.hashCode} contract.
+ * Implementators are strongly encouraged but not
+ * strictly required to override the default {@link Object}
+ * implementation of this method.
+ *
+ * @see #equals
+ * @return a hash code for this functor
+ */
+ int hashCode();
+
+ /**
+ * Indicates whether some other object is "equal to"
+ * this functor. This method must adhere to
+ * general {@link Object#equals Object.equals} contract.
+ * Additionally, this method can return
+ * <tt>true</tt> <i>only</i> if the specified Object implements
+ * the same functor interface and is known to produce the same
+ * results and/or side-effects for the same arguments (if any).
+ * <p>
+ * While implementators are strongly encouraged to override
+ * the default Object implementation of this method,
+ * note that the default Object implementation
+ * does in fact adhere to the functor <code>equals</code> contract.
+ * </p>
+ * @param that the object to compare this functor to
+ * @see #hashCode
+ * @return <code>true</code> iff the given object implements
+ * this functor interface, and is known to produce the same
+ * results and/or side-effects for the same arguments
+ * (if any).
+ */
+ boolean equals(Object that);
+}
Propchange: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Functor.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/NullaryFunctor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/NullaryFunctor.java?rev=647290&view=auto
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/NullaryFunctor.java (added)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/NullaryFunctor.java Fri Apr 11 13:08:44 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.functor;
+
+/**
+ * Marker interface for nullary (zero-argument) functors.
+ * <p>
+ * Implementors are encouraged but not required to make their functors
+ * {@link java.io.Serializable Serializable}.
+ * </p>
+ *
+ * @since 1.0
+ * @version $Revision$ $Date$
+ */
+public interface NullaryFunctor extends Functor {
+}
Propchange: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/NullaryFunctor.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Predicate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Predicate.java?rev=647290&r1=647289&r2=647290&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Predicate.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Predicate.java Fri Apr 11 13:08:44 2008
@@ -27,55 +27,10 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface Predicate {
+public interface Predicate extends NullaryFunctor {
/**
* Evaluate this predicate.
* @return the result of this test
*/
boolean test();
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}
Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Procedure.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Procedure.java?rev=647290&r1=647289&r2=647290&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Procedure.java (original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/Procedure.java Fri Apr 11 13:08:44 2008
@@ -33,52 +33,7 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface Procedure extends Runnable {
+public interface Procedure extends NullaryFunctor, Runnable {
/** Execute this procedure. */
void run();
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}
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=647290&r1=647289&r2=647290&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 Fri Apr 11 13:08:44 2008
@@ -27,7 +27,7 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface UnaryFunction {
+public interface UnaryFunction extends UnaryFunctor {
/**
* Evaluate this function.
*
@@ -35,49 +35,4 @@
* @return the result of this evaluation
*/
Object evaluate(Object obj);
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}
Added: 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=647290&view=auto
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java (added)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java Fri Apr 11 13:08:44 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.functor;
+
+/**
+ * Marker interface for unary (single-argument) functors.
+ * <p>
+ * Implementors are encouraged but not required to make their functors
+ * {@link java.io.Serializable Serializable}.
+ * </p>
+ *
+ * @since 1.0
+ * @version $Revision$ $Date$
+ */
+public interface UnaryFunctor extends Functor {
+}
Propchange: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/UnaryFunctor.java
------------------------------------------------------------------------------
svn:eol-style = native
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=647290&r1=647289&r2=647290&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 Fri Apr 11 13:08:44 2008
@@ -27,7 +27,7 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface UnaryPredicate {
+public interface UnaryPredicate extends UnaryFunctor {
/**
* Evaluate this predicate.
*
@@ -35,49 +35,4 @@
* @return the result of this test
*/
boolean test(Object obj);
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}
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=647290&r1=647289&r2=647290&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 Fri Apr 11 13:08:44 2008
@@ -27,55 +27,10 @@
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
-public interface UnaryProcedure {
+public interface UnaryProcedure extends UnaryFunctor {
/**
* Execute this procedure.
* @param obj a parameter to this execution
*/
void run(Object obj);
-
- /**
- * Returns a human readable description of this functor.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @return a human readable description of this functor
- */
- String toString();
-
- /**
- * Returns a hash code for this functor adhering to the
- * general {@link Object#hashCode Object.hashCode} contract.
- * Implementators are strongly encouraged but not
- * strictly required to override the default {@link Object}
- * implementation of this method.
- *
- * @see #equals
- * @return a hash code for this functor
- */
- int hashCode();
-
- /**
- * Indicates whether some other object is "equal to"
- * this functor. This method must adhere to
- * general {@link Object#equals Object.equals} contract.
- * Additionally, this method can return
- * <tt>true</tt> <i>only</i> if the specified Object implements
- * the same functor interface and is known to produce the same
- * results and/or side-effects for the same arguments (if any).
- * <p>
- * While implementators are strongly encouraged to override
- * the default Object implementation of this method,
- * note that the default Object implementation
- * does in fact adhere to the functor <code>equals</code> contract.
- * </p>
- * @param that the object to compare this functor to
- * @see #hashCode
- * @return <code>true</code> iff the given object implements
- * this functor interface, and is known to produce the same
- * results and/or side-effects for the same arguments
- * (if any).
- */
- boolean equals(Object that);
}