Add additional javadoc

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131665 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2004-04-14 20:08:57 +00:00
parent 9cfe01cf6d
commit 834641d84a
4 changed files with 44 additions and 20 deletions

View File

@ -18,18 +18,21 @@ package org.apache.commons.collections;
/**
* 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
* {@link ClosureUtils}. These include method invokation and for/while loops.
*
* @since Commons Collections 1.0
* @version $Revision: 1.10 $ $Date: 2004/02/18 01:15:42 $
* @version $Revision: 1.11 $ $Date: 2004/04/14 20:08:56 $
*
* @author James Strachan
* @author Nicola Ken Barozzi
* @author Stephen Colebourne
*/
public interface Closure {
/**
* Performs an action on the specified input object.
*
@ -39,5 +42,5 @@ public interface Closure {
* @throws FunctorException (runtime) if any other error occurs
*/
public void execute(Object input);
}

View File

@ -17,15 +17,22 @@ package org.apache.commons.collections;
/**
* 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 {@link Transformer} is more appropriate.
* <p>
* Standard implementations of common factories are provided by
* {@link FactoryUtils}. These include factories that return a constant,
* a copy of a prototype or a new instance.
*
* @since Commons Collections 2.1
* @version $Revision: 1.8 $ $Date: 2004/02/18 01:15:42 $
* @version $Revision: 1.9 $ $Date: 2004/04/14 20:08:57 $
*
* @author Arron Bates
* @author Stephen Colebourne
*/
public interface Factory {
/**
* Create a new object.
*
@ -33,5 +40,5 @@ public interface Factory {
* @throws FunctorException (runtime) if the factory cannot create an object
*/
public Object create();
}

View File

@ -16,27 +16,34 @@
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
* {@link PredicateUtils}. These include true, false, instanceof, equals, and,
* or, not, method invokation and null testing.
*
* @since Commons Collections 1.0
* @version $Revision: 1.10 $ $Date: 2004/02/18 01:15:42 $
* @version $Revision: 1.11 $ $Date: 2004/04/14 20:08:57 $
*
* @author James Strachan
* @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);
}

View File

@ -16,13 +16,20 @@
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
* {@link TransformerUtils}. These include method invokation, returning a constant,
* cloning and returning the string value.
*
* @since Commons Collections 1.0
* @version $Revision: 1.9 $ $Date: 2004/02/18 01:15:42 $
* @version $Revision: 1.10 $ $Date: 2004/04/14 20:08:57 $
*
* @author James Strachan
* @author Stephen Colebourne
@ -32,12 +39,12 @@ public interface Transformer {
/**
* 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);
}