scolebourne 2004/04/14 13:08:57
Modified: collections/src/java/org/apache/commons/collections
Closure.java Transformer.java Predicate.java
Factory.java
Log:
Add additional javadoc
Revision Changes Path
1.11 +8 -5
jakarta-commons/collections/src/java/org/apache/commons/collections/Closure.java
Index: Closure.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/Closure.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Closure.java 18 Feb 2004 01:15:42 -0000 1.10
+++ Closure.java 14 Apr 2004 20:08:56 -0000 1.11
@@ -18,8 +18,11 @@
/**
* Defines a functor interface implemented by classes that do something.
* <p>
- * A Closure represents a block of code which is executed from inside some
- * block, function or iteration. It operates an input object.
+ * A <code>Closure</code> represents a block of code which is executed from
+ * inside some block, function or iteration. It operates an input object.
+ * <p>
+ * Standard implementations of common closures are provided by
+ * [EMAIL PROTECTED] ClosureUtils}. These include method invokation and for/while
loops.
*
* @since Commons Collections 1.0
* @version $Revision$ $Date$
@@ -29,7 +32,7 @@
* @author Stephen Colebourne
*/
public interface Closure {
-
+
/**
* Performs an action on the specified input object.
*
@@ -39,5 +42,5 @@
* @throws FunctorException (runtime) if any other error occurs
*/
public void execute(Object input);
-
+
}
1.10 +12 -5
jakarta-commons/collections/src/java/org/apache/commons/collections/Transformer.java
Index: Transformer.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/Transformer.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Transformer.java 18 Feb 2004 01:15:42 -0000 1.9
+++ Transformer.java 14 Apr 2004 20:08:57 -0000 1.10
@@ -16,10 +16,17 @@
package org.apache.commons.collections;
/**
- * Defines a functor interface implemented by classes that
- * transform one object into another. The original object is left unchanged.
+ * Defines a functor interface implemented by classes that transform one
+ * object into another.
+ * <p>
+ * A <code>Transformer</code> converts the input object to the output object.
+ * The input object should be left unchanged.
* Transformers are typically used for type conversions, or extracting data
* from an object.
+ * <p>
+ * Standard implementations of common transformers are provided by
+ * [EMAIL PROTECTED] TransformerUtils}. These include method invokation, returning
a constant,
+ * cloning and returning the string value.
*
* @since Commons Collections 1.0
* @version $Revision$ $Date$
@@ -32,12 +39,12 @@
/**
* Transforms the input object (leaving it unchanged) into some output object.
*
- * @param input the object to be transformed
+ * @param input the object to be transformed, should be left unchanged
* @return a transformed object
* @throws ClassCastException (runtime) if the input is the wrong class
* @throws IllegalArgumentException (runtime) if the input is invalid
* @throws FunctorException (runtime) if the transform cannot be completed
*/
public Object transform(Object input);
-
+
}
1.11 +14 -7
jakarta-commons/collections/src/java/org/apache/commons/collections/Predicate.java
Index: Predicate.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/Predicate.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Predicate.java 18 Feb 2004 01:15:42 -0000 1.10
+++ Predicate.java 14 Apr 2004 20:08:57 -0000 1.11
@@ -16,9 +16,16 @@
package org.apache.commons.collections;
/**
- * Defines a functor interface implemented by classes that
- * perform a predicate test on an object. Predicate instances can be used
- * to implement queries or to do filtering.
+ * Defines a functor interface implemented by classes that perform a predicate
+ * test on an object.
+ * <p>
+ * A <code>Predicate</code> is the object equivalent of an <code>if</code>
statement.
+ * It uses the input object to return a true or false value, and is often used in
+ * validation or filtering.
+ * <p>
+ * Standard implementations of common predicates are provided by
+ * [EMAIL PROTECTED] PredicateUtils}. These include true, false, instanceof,
equals, and,
+ * or, not, method invokation and null testing.
*
* @since Commons Collections 1.0
* @version $Revision$ $Date$
@@ -27,16 +34,16 @@
* @author Stephen Colebourne
*/
public interface Predicate {
-
+
/**
* Use the specified parameter to perform a test that returns true or false.
*
- * @param object the object to evaluate
+ * @param object the object to evaluate, should not be changed
* @return true or false
* @throws ClassCastException (runtime) if the input is the wrong class
* @throws IllegalArgumentException (runtime) if the input is invalid
* @throws FunctorException (runtime) if the predicate encounters a problem
*/
public boolean evaluate(Object object);
-
+
}
1.9 +10 -3
jakarta-commons/collections/src/java/org/apache/commons/collections/Factory.java
Index: Factory.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/Factory.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Factory.java 18 Feb 2004 01:15:42 -0000 1.8
+++ Factory.java 14 Apr 2004 20:08:57 -0000 1.9
@@ -17,6 +17,13 @@
/**
* Defines a functor interface implemented by classes that create objects.
+ * <p>
+ * A <code>Factory</code> creates an object without using an input parameter.
+ * If an input parameter is required, then [EMAIL PROTECTED] Transformer} is more
appropriate.
+ * <p>
+ * Standard implementations of common factories are provided by
+ * [EMAIL PROTECTED] FactoryUtils}. These include factories that return a constant,
+ * a copy of a prototype or a new instance.
*
* @since Commons Collections 2.1
* @version $Revision$ $Date$
@@ -25,7 +32,7 @@
* @author Stephen Colebourne
*/
public interface Factory {
-
+
/**
* Create a new object.
*
@@ -33,5 +40,5 @@
* @throws FunctorException (runtime) if the factory cannot create an object
*/
public Object create();
-
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]