Author: scolebourne Date: Sun Nov 5 11:24:09 2006 New Revision: 471498 URL: http://svn.apache.org/viewvc?view=rev&rev=471498 Log: Generify
Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Transformer.java Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java?view=diff&rev=471498&r1=471497&r2=471498 ============================================================================== --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java Sun Nov 5 11:24:09 2006 @@ -24,7 +24,8 @@ * <p> * Standard implementations of common closures are provided by * [EMAIL PROTECTED] ClosureUtils}. These include method invokation and for/while loops. - * + * + * @param <T> the type that the closure acts on * @since Commons Collections 1.0 * @version $Revision$ $Date$ * @@ -32,7 +33,7 @@ * @author Nicola Ken Barozzi * @author Stephen Colebourne */ -public interface Closure { +public interface Closure<T> { /** * Performs an action on the specified input object. @@ -42,6 +43,6 @@ * @throws IllegalArgumentException (runtime) if the input is invalid * @throws FunctorException (runtime) if any other error occurs */ - public void execute(Object input); + public void execute(T input); } Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java?view=diff&rev=471498&r1=471497&r2=471498 ============================================================================== --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java Sun Nov 5 11:24:09 2006 @@ -26,13 +26,14 @@ * [EMAIL PROTECTED] FactoryUtils}. These include factories that return a constant, * a copy of a prototype or a new instance. * + * @param <T> the type that the factory creates * @since Commons Collections 2.1 * @version $Revision$ $Date$ * * @author Arron Bates * @author Stephen Colebourne */ -public interface Factory { +public interface Factory<T> { /** * Create a new object. @@ -40,6 +41,6 @@ * @return a new object * @throws FunctorException (runtime) if the factory cannot create an object */ - public Object create(); + public T create(); } Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java?view=diff&rev=471498&r1=471497&r2=471498 ============================================================================== --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java Sun Nov 5 11:24:09 2006 @@ -28,13 +28,14 @@ * [EMAIL PROTECTED] PredicateUtils}. These include true, false, instanceof, equals, and, * or, not, method invokation and null testing. * + * @param <T> the type that the predicate queries * @since Commons Collections 1.0 * @version $Revision$ $Date$ * * @author James Strachan * @author Stephen Colebourne */ -public interface Predicate { +public interface Predicate<T> { /** * Use the specified parameter to perform a test that returns true or false. @@ -45,6 +46,6 @@ * @throws IllegalArgumentException (runtime) if the input is invalid * @throws FunctorException (runtime) if the predicate encounters a problem */ - public boolean evaluate(Object object); + public boolean evaluate(T object); } Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Transformer.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Transformer.java?view=diff&rev=471498&r1=471497&r2=471498 ============================================================================== --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Transformer.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Transformer.java Sun Nov 5 11:24:09 2006 @@ -29,13 +29,15 @@ * [EMAIL PROTECTED] TransformerUtils}. These include method invokation, returning a constant, * cloning and returning the string value. * + * @param <I> the input type to the transformer + * @param <O> the output type from the transformer * @since Commons Collections 1.0 * @version $Revision$ $Date$ * * @author James Strachan * @author Stephen Colebourne */ -public interface Transformer { +public interface Transformer<I, O> { /** * Transforms the input object (leaving it unchanged) into some output object. @@ -46,6 +48,6 @@ * @throws IllegalArgumentException (runtime) if the input is invalid * @throws FunctorException (runtime) if the transform cannot be completed */ - public Object transform(Object input); + public O transform(I input); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]