diff --git a/src/java/org/apache/commons/collections/ClosureUtils.java b/src/java/org/apache/commons/collections/ClosureUtils.java index b2889008e..4259366ac 100644 --- a/src/java/org/apache/commons/collections/ClosureUtils.java +++ b/src/java/org/apache/commons/collections/ClosureUtils.java @@ -46,7 +46,7 @@ import org.apache.commons.collections.functors.WhileClosure; * All the supplied closures are Serializable. * * @since Commons Collections 3.0 - * @version $Revision: 1.7 $ $Date: 2004/02/18 01:15:42 $ + * @version $Revision: 1.8 $ $Date: 2004/04/14 21:47:47 $ * * @author Stephen Colebourne */ @@ -63,6 +63,8 @@ public class ClosureUtils { * Gets a Closure that always throws an exception. * This could be useful during testing as a placeholder. * + * @see org.apache.commons.collections.functors.ExceptionClosure + * * @return the closure */ public static Closure exceptionClosure() { @@ -73,6 +75,8 @@ public class ClosureUtils { * Gets a Closure that will do nothing. * This could be useful during testing as a placeholder. * + * @see org.apache.commons.collections.functors.NOPClosure + * * @return the closure */ public static Closure nopClosure() { @@ -84,6 +88,8 @@ public class ClosureUtils { * The transformer will be called using the closure's input object. * The transformer's result will be ignored. * + * @see org.apache.commons.collections.functors.TransformerClosure + * * @param transformer the transformer to run each time in the closure, null means nop * @return the closure */ @@ -96,6 +102,8 @@ public class ClosureUtils { *
* A null closure or zero count returns the NOPClosure
.
*
+ * @see org.apache.commons.collections.functors.ForClosure
+ *
* @param count the number of times to loop
* @param closure the closure to call repeatedly
* @return the for
closure
@@ -108,6 +116,8 @@ public class ClosureUtils {
* Creates a Closure that will call the closure repeatedly until the
* predicate returns false.
*
+ * @see org.apache.commons.collections.functors.WhileClosure
+ *
* @param predicate the predicate to use as an end of loop test, not null
* @param closure the closure to call repeatedly, not null
* @return the while
closure
@@ -121,6 +131,8 @@ public class ClosureUtils {
* Creates a Closure that will call the closure once and then repeatedly
* until the predicate returns false.
*
+ * @see org.apache.commons.collections.functors.WhileClosure
+ *
* @param closure the closure to call repeatedly, not null
* @param predicate the predicate to use as an end of loop test, not null
* @return the do-while
closure
@@ -134,6 +146,9 @@ public class ClosureUtils {
* Creates a Closure that will invoke a specific method on the closure's
* input object by reflection.
*
+ * @see org.apache.commons.collections.functors.InvokerTransformer
+ * @see org.apache.commons.collections.functors.TransformerClosure
+ *
* @param methodName the name of the method
* @return the invoker
closure
* @throws IllegalArgumentException if the method name is null
@@ -147,6 +162,9 @@ public class ClosureUtils {
* Creates a Closure that will invoke a specific method on the closure's
* input object by reflection.
*
+ * @see org.apache.commons.collections.functors.InvokerTransformer
+ * @see org.apache.commons.collections.functors.TransformerClosure
+ *
* @param methodName the name of the method
* @param paramTypes the parameter types
* @param args the arguments
@@ -163,6 +181,8 @@ public class ClosureUtils {
* Create a new Closure that calls two Closures, passing the result of
* the first into the second.
*
+ * @see org.apache.commons.collections.functors.ChainedClosure
+ *
* @param closure1 the first closure
* @param closure2 the second closure
* @return the chained
closure
@@ -176,6 +196,8 @@ public class ClosureUtils {
* Create a new Closure that calls each closure in turn, passing the
* result into the next closure.
*
+ * @see org.apache.commons.collections.functors.ChainedClosure
+ *
* @param closures an array of closures to chain
* @return the chained
closure
* @throws IllegalArgumentException if the closures array is null
@@ -190,6 +212,8 @@ public class ClosureUtils {
* result into the next closure. The ordering is that of the iterator()
* method on the collection.
*
+ * @see org.apache.commons.collections.functors.ChainedClosure
+ *
* @param closures a collection of closures to chain
* @return the chained
closure
* @throws IllegalArgumentException if the closures collection is null
@@ -204,6 +228,8 @@ public class ClosureUtils {
* Create a new Closure that calls one of two closures depending
* on the specified predicate.
*
+ * @see org.apache.commons.collections.functors.IfClosure
+ *
* @param predicate the predicate to switch on
* @param trueClosure the closure called if the predicate is true
* @param falseClosure the closure called if the predicate is false
@@ -223,6 +249,8 @@ public class ClosureUtils {
* location 0 returned true. Each predicate is evaluated
* until one returns true.
*
+ * @see org.apache.commons.collections.functors.SwitchClosure
+ *
* @param predicates an array of predicates to check, not null
* @param closures an array of closures to call, not null
* @return the switch
closure
@@ -243,6 +271,8 @@ public class ClosureUtils {
* until one returns true. If no predicates evaluate to true, the default
* closure is called.
*
+ * @see org.apache.commons.collections.functors.SwitchClosure
+ *
* @param predicates an array of predicates to check, not null
* @param closures an array of closures to call, not null
* @param defaultClosure the default to call if no predicate matches
@@ -266,6 +296,8 @@ public class ClosureUtils {
* null key. The ordering is that of the iterator() method on the entryset
* collection of the map.
*
+ * @see org.apache.commons.collections.functors.SwitchClosure
+ *
* @param predicatesAndClosures a map of predicates to closures
* @return the switch
closure
* @throws IllegalArgumentException if the map is null
@@ -286,6 +318,8 @@ public class ClosureUtils {
* default closure is called. The default closure is set in the map
* using a null key.
*
+ * @see org.apache.commons.collections.functors.SwitchClosure
+ *
* @param objectsAndClosures a map of objects to closures
* @return the closure
* @throws IllegalArgumentException if the map is null
diff --git a/src/java/org/apache/commons/collections/FactoryUtils.java b/src/java/org/apache/commons/collections/FactoryUtils.java
index b403a60ad..252be2b6a 100644
--- a/src/java/org/apache/commons/collections/FactoryUtils.java
+++ b/src/java/org/apache/commons/collections/FactoryUtils.java
@@ -33,7 +33,7 @@ import org.apache.commons.collections.functors.PrototypeFactory;
* All the supplied factories are Serializable.
*
* @since Commons Collections 3.0
- * @version $Revision: 1.13 $ $Date: 2004/02/18 01:15:42 $
+ * @version $Revision: 1.14 $ $Date: 2004/04/14 21:47:47 $
*
* @author Stephen Colebourne
*/
@@ -50,6 +50,8 @@ public class FactoryUtils {
* Gets a Factory that always throws an exception.
* This could be useful during testing as a placeholder.
*
+ * @see org.apache.commons.collections.functors.ExceptionFactory
+ *
* @return the factory
*/
public static Factory exceptionFactory() {
@@ -60,6 +62,8 @@ public class FactoryUtils {
* Gets a Factory that will return null each time the factory is used.
* This could be useful during testing as a placeholder.
*
+ * @see org.apache.commons.collections.functors.ConstantFactory
+ *
* @return the factory
*/
public static Factory nullFactory() {
@@ -72,6 +76,8 @@ public class FactoryUtils {
* immutable objects should use the constant factory. Mutable objects should
* use the prototype factory.
*
+ * @see org.apache.commons.collections.functors.ConstantFactory
+ *
* @param constantToReturn the constant object to return each time in the factory
* @return the constant
factory.
*/
@@ -89,6 +95,8 @@ public class FactoryUtils {
*
prototype
factory
* @throws IllegalArgumentException if the prototype is null
@@ -102,6 +110,8 @@ public class FactoryUtils {
* Creates a Factory that can create objects of a specific type using
* a no-args constructor.
*
+ * @see org.apache.commons.collections.functors.InstantiateFactory
+ *
* @param classToInstantiate the Class to instantiate each time in the factory
* @return the reflection
factory
* @throws IllegalArgumentException if the classToInstantiate is null
@@ -114,6 +124,8 @@ public class FactoryUtils {
* Creates a Factory that can create objects of a specific type using
* the arguments specified to this method.
*
+ * @see org.apache.commons.collections.functors.InstantiateFactory
+ *
* @param classToInstantiate the Class to instantiate each time in the factory
* @param paramTypes parameter types for the constructor, can be null
* @param args the arguments to pass to the constructor, can be null
diff --git a/src/java/org/apache/commons/collections/PredicateUtils.java b/src/java/org/apache/commons/collections/PredicateUtils.java
index cf5f1ef2d..011005fec 100644
--- a/src/java/org/apache/commons/collections/PredicateUtils.java
+++ b/src/java/org/apache/commons/collections/PredicateUtils.java
@@ -64,7 +64,7 @@ import org.apache.commons.collections.functors.UniquePredicate;
* All the supplied predicates are Serializable.
*
* @since Commons Collections 3.0
- * @version $Revision: 1.17 $ $Date: 2004/03/13 16:34:46 $
+ * @version $Revision: 1.18 $ $Date: 2004/04/14 21:47:47 $
*
* @author Stephen Colebourne
* @author Ola Berg
@@ -85,6 +85,8 @@ public class PredicateUtils {
* Gets a Predicate that always throws an exception.
* This could be useful during testing as a placeholder.
*
+ * @see org.apache.commons.collections.functors.ExceptionPredicate
+ *
* @return the predicate
*/
public static Predicate exceptionPredicate() {
@@ -94,6 +96,8 @@ public class PredicateUtils {
/**
* Gets a Predicate that always returns true.
*
+ * @see org.apache.commons.collections.functors.TruePredicate
+ *
* @return the predicate
*/
public static Predicate truePredicate() {
@@ -103,6 +107,8 @@ public class PredicateUtils {
/**
* Gets a Predicate that always returns false.
*
+ * @see org.apache.commons.collections.functors.FalsePredicate
+ *
* @return the predicate
*/
public static Predicate falsePredicate() {
@@ -112,6 +118,8 @@ public class PredicateUtils {
/**
* Gets a Predicate that checks if the input object passed in is null.
*
+ * @see org.apache.commons.collections.functors.NullPredicate
+ *
* @return the predicate
*/
public static Predicate nullPredicate() {
@@ -121,6 +129,8 @@ public class PredicateUtils {
/**
* Gets a Predicate that checks if the input object passed in is not null.
*
+ * @see org.apache.commons.collections.functors.NotNullPredicate
+ *
* @return the predicate
*/
public static Predicate notNullPredicate() {
@@ -131,6 +141,8 @@ public class PredicateUtils {
* Creates a Predicate that checks if the input object is equal to the
* specified object using equals().
*
+ * @see org.apache.commons.collections.functors.EqualPredicate
+ *
* @param value the value to compare against
* @return the predicate
*/
@@ -142,6 +154,8 @@ public class PredicateUtils {
* Creates a Predicate that checks if the input object is equal to the
* specified object by identity.
*
+ * @see org.apache.commons.collections.functors.IdentityPredicate
+ *
* @param value the value to compare against
* @return the predicate
*/
@@ -154,6 +168,8 @@ public class PredicateUtils {
* a particular type, using instanceof. A null
input
* object will return false
.
*
+ * @see org.apache.commons.collections.functors.InstanceofPredicate
+ *
* @param type the type to check for, may not be null
* @return the predicate
* @throws IllegalArgumentException if the class is null
@@ -169,6 +185,8 @@ public class PredicateUtils {
* is accepted and will return true the first time, and false subsequently
* as well.
*
+ * @see org.apache.commons.collections.functors.UniquePredicate
+ *
* @return the predicate
*/
public static Predicate uniquePredicate() {
@@ -186,6 +204,9 @@ public class PredicateUtils {
* will call the isEmpty
method on the input object to
* determine the predicate result.
*
+ * @see org.apache.commons.collections.functors.InvokerTransformer
+ * @see org.apache.commons.collections.functors.TransformerPredicate
+ *
* @param methodName the method name to call on the input object, may not be null
* @return the predicate
* @throws IllegalArgumentException if the methodName is null.
@@ -205,6 +226,9 @@ public class PredicateUtils {
* will call the isEmpty
method on the input object to
* determine the predicate result.
*
+ * @see org.apache.commons.collections.functors.InvokerTransformer
+ * @see org.apache.commons.collections.functors.TransformerPredicate
+ *
* @param methodName the method name to call on the input object, may not be null
* @param paramTypes the parameter types
* @param args the arguments
@@ -224,6 +248,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true only if both of the specified
* predicates are true.
*
+ * @see org.apache.commons.collections.functors.AndPredicate
+ *
* @param predicate1 the first predicate, may not be null
* @param predicate2 the second predicate, may not be null
* @return the and
predicate
@@ -237,6 +263,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true only if all of the specified
* predicates are true.
*
+ * @see org.apache.commons.collections.functors.AllPredicate
+ *
* @param predicates an array of predicates to check, may not be null
* @return the all
predicate
* @throws IllegalArgumentException if the predicates array is null
@@ -251,6 +279,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true only if all of the specified
* predicates are true. The predicates are checked in iterator order.
*
+ * @see org.apache.commons.collections.functors.AllPredicate
+ *
* @param predicates a collection of predicates to check, may not be null
* @return the all
predicate
* @throws IllegalArgumentException if the predicates collection is null
@@ -265,6 +295,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if either of the specified
* predicates are true.
*
+ * @see org.apache.commons.collections.functors.OrPredicate
+ *
* @param predicate1 the first predicate, may not be null
* @param predicate2 the second predicate, may not be null
* @return the or
predicate
@@ -278,6 +310,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if any of the specified
* predicates are true.
*
+ * @see org.apache.commons.collections.functors.AnyPredicate
+ *
* @param predicates an array of predicates to check, may not be null
* @return the any
predicate
* @throws IllegalArgumentException if the predicates array is null
@@ -292,6 +326,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if any of the specified
* predicates are true. The predicates are checked in iterator order.
*
+ * @see org.apache.commons.collections.functors.AnyPredicate
+ *
* @param predicates a collection of predicates to check, may not be null
* @return the any
predicate
* @throws IllegalArgumentException if the predicates collection is null
@@ -306,6 +342,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if one, but not both, of the
* specified predicates are true.
*
+ * @see org.apache.commons.collections.functors.OnePredicate
+ *
* @param predicate1 the first predicate, may not be null
* @param predicate2 the second predicate, may not be null
* @return the either
predicate
@@ -319,6 +357,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if only one of the specified
* predicates are true.
*
+ * @see org.apache.commons.collections.functors.OnePredicate
+ *
* @param predicates an array of predicates to check, may not be null
* @return the one
predicate
* @throws IllegalArgumentException if the predicates array is null
@@ -333,6 +373,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if only one of the specified
* predicates are true. The predicates are checked in iterator order.
*
+ * @see org.apache.commons.collections.functors.OnePredicate
+ *
* @param predicates a collection of predicates to check, may not be null
* @return the one
predicate
* @throws IllegalArgumentException if the predicates collection is null
@@ -347,6 +389,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if neither of the specified
* predicates are true.
*
+ * @see org.apache.commons.collections.functors.NonePredicate
+ *
* @param predicate1 the first predicate, may not be null
* @param predicate2 the second predicate, may not be null
* @return the neither
predicate
@@ -360,6 +404,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if none of the specified
* predicates are true.
*
+ * @see org.apache.commons.collections.functors.NonePredicate
+ *
* @param predicates an array of predicates to check, may not be null
* @return the none
predicate
* @throws IllegalArgumentException if the predicates array is null
@@ -374,6 +420,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if none of the specified
* predicates are true. The predicates are checked in iterator order.
*
+ * @see org.apache.commons.collections.functors.NonePredicate
+ *
* @param predicates a collection of predicates to check, may not be null
* @return the none
predicate
* @throws IllegalArgumentException if the predicates collection is null
@@ -388,6 +436,8 @@ public class PredicateUtils {
* Create a new Predicate that returns true if the specified predicate
* returns false and vice versa.
*
+ * @see org.apache.commons.collections.functors.NotPredicate
+ *
* @param predicate the predicate to not
* @return the not
predicate
* @throws IllegalArgumentException if the predicate is null
@@ -404,6 +454,8 @@ public class PredicateUtils {
* return either Boolean.TRUE or Boolean.FALSE otherwise a PredicateException
* will be thrown.
*
+ * @see org.apache.commons.collections.functors.TransformerPredicate
+ *
* @param transformer the transformer to wrap, may not be null
* @return the transformer wrapping predicate
* @throws IllegalArgumentException if the transformer is null
@@ -420,6 +472,8 @@ public class PredicateUtils {
* otherwise it calls the specified Predicate. This allows null handling
* behaviour to be added to Predicates that don't support nulls.
*
+ * @see org.apache.commons.collections.functors.NullIsExceptionPredicate
+ *
* @param predicate the predicate to wrap, may not be null
* @return the predicate
* @throws IllegalArgumentException if the predicate is null.
@@ -433,6 +487,8 @@ public class PredicateUtils {
* it calls the specified Predicate. This allows null handling behaviour to
* be added to Predicates that don't support nulls.
*
+ * @see org.apache.commons.collections.functors.NullIsFalsePredicate
+ *
* @param predicate the predicate to wrap, may not be null
* @return the predicate
* @throws IllegalArgumentException if the predicate is null.
@@ -446,6 +502,8 @@ public class PredicateUtils {
* it calls the specified Predicate. This allows null handling behaviour to
* be added to Predicates that don't support nulls.
*
+ * @see org.apache.commons.collections.functors.NullIsTruePredicate
+ *
* @param predicate the predicate to wrap, may not be null
* @return the predicate
* @throws IllegalArgumentException if the predicate is null.
@@ -460,6 +518,8 @@ public class PredicateUtils {
* Creates a predicate that transforms the input object before passing it
* to the predicate.
*
+ * @see org.apache.commons.collections.functors.TransformedPredicate
+ *
* @param transformer the transformer to call first
* @param predicate the predicate to call with the result of the transform
* @return the predicate
diff --git a/src/java/org/apache/commons/collections/TransformerUtils.java b/src/java/org/apache/commons/collections/TransformerUtils.java
index bbe456653..90f160d1b 100644
--- a/src/java/org/apache/commons/collections/TransformerUtils.java
+++ b/src/java/org/apache/commons/collections/TransformerUtils.java
@@ -56,7 +56,7 @@ import org.apache.commons.collections.functors.SwitchTransformer;
* All the supplied transformers are Serializable.
*
* @since Commons Collections 3.0
- * @version $Revision: 1.11 $ $Date: 2004/02/18 01:15:42 $
+ * @version $Revision: 1.12 $ $Date: 2004/04/14 21:47:47 $
*
* @author Stephen Colebourne
* @author James Carman
@@ -74,6 +74,8 @@ public class TransformerUtils {
* Gets a transformer that always throws an exception.
* This could be useful during testing as a placeholder.
*
+ * @see org.apache.commons.collections.functors.ExceptionTransformer
+ *
* @return the transformer
*/
public static Transformer exceptionTransformer() {
@@ -83,6 +85,8 @@ public class TransformerUtils {
/**
* Gets a transformer that always returns null.
*
+ * @see org.apache.commons.collections.functors.ConstantTransformer
+ *
* @return the transformer
*/
public static Transformer nullTransformer() {
@@ -94,6 +98,8 @@ public class TransformerUtils {
* The input object should be immutable to maintain the
* contract of Transformer (although this is not checked).
*
+ * @see org.apache.commons.collections.functors.NOPTransformer
+ *
* @return the transformer
*/
public static Transformer nopTransformer() {
@@ -110,6 +116,8 @@ public class TransformerUtils {
* getName/code> method on the input object to
* determine the transformer result.
*
+ * @see org.apache.commons.collections.functors.InvokerTransformer
+ *
* @param methodName the method name to call on the input object, may not be null
* @return the transformer
* @throws IllegalArgumentException if the methodName is null.
@@ -371,6 +411,8 @@ public class TransformerUtils {
* The method parameters are specified. If the input object is null,
* null is returned.
*
+ * @see org.apache.commons.collections.functors.InvokerTransformer
+ *
* @param methodName the name of the method
* @param paramTypes the parameter types
* @param args the arguments
@@ -387,6 +429,8 @@ public class TransformerUtils {
* representation of the input object. This is achieved via the
* toString
method, null
returns 'null'.
*
+ * @see org.apache.commons.collections.functors.StringValueTransformer
+ *
* @return the transformer
*/
public static Transformer stringValueTransformer() {