Remove trailing spaces.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1477798 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-04-30 19:49:02 +00:00
parent 88564caa20
commit b7a0c8d3de
31 changed files with 135 additions and 138 deletions

View File

@ -30,10 +30,10 @@ public abstract class AbstractQuantifierPredicate<T> implements Predicate<T>, Pr
/** Serial version UID */
private static final long serialVersionUID = -3094696765038308799L;
/** The array of predicates to call */
protected final Predicate<? super T>[] iPredicates;
/**
* Constructor that performs no validation.
*
@ -45,7 +45,7 @@ public abstract class AbstractQuantifierPredicate<T> implements Predicate<T>, Pr
/**
* Gets the predicates.
*
*
* @return a copy of the predicates
* @since 3.1
*/

View File

@ -40,7 +40,7 @@ public final class AllPredicate<T> extends AbstractQuantifierPredicate<T> implem
/** Serial version UID */
private static final long serialVersionUID = -3094696765038308799L;
/**
* Factory to create the predicate.
* <p>
@ -100,7 +100,7 @@ public final class AllPredicate<T> extends AbstractQuantifierPredicate<T> implem
/**
* Evaluates the predicate returning true if all predicates return true.
*
*
* @param object the input object
* @return true if all decorated predicates return true
*/

View File

@ -22,17 +22,17 @@ import org.apache.commons.collections4.FunctorException;
/**
* {@link Closure} that catches any checked exception and re-throws it as a
* {@link FunctorException} runtime exception. Example usage:
*
*
* <pre>
* // Create a catch and re-throw closure via anonymous subclass
* CatchAndRethrowClosure&lt;String&gt; writer = new ThrowingClosure() {
* private java.io.Writer out = // some writer
*
*
* protected void executeAndThrow(String input) throws IOException {
* out.write(input); // throwing of IOException allowed
* }
* };
*
*
* // use catch and re-throw closure
* java.util.List<String> strList = // some list
* try {
@ -42,7 +42,7 @@ import org.apache.commons.collections4.FunctorException;
* // handle error
* }
* </pre>
*
*
* @since 4.0
* @version $Id$
*/
@ -50,7 +50,7 @@ public abstract class CatchAndRethrowClosure<E> implements Closure<E> {
/**
* Execute this closure on the specified input object.
*
*
* @param input the input to execute on
* @throws FunctorException (runtime) if the closure execution resulted in a
* checked exception.
@ -67,7 +67,7 @@ public abstract class CatchAndRethrowClosure<E> implements Closure<E> {
/**
* Execute this closure on the specified input object.
*
*
* @param input the input to execute on
* @throws Throwable if the closure execution resulted in a checked
* exception.

View File

@ -37,7 +37,7 @@ public class ChainedClosure<E> implements Closure<E>, Serializable {
/**
* Factory method that performs validation and copies the parameter array.
*
*
* @param <E> the type that the closure acts on
* @param closures the closures to chain, copied, no nulls
* @return the <code>chained</code> closure
@ -53,10 +53,10 @@ public class ChainedClosure<E> implements Closure<E>, Serializable {
}
/**
* Create a new Closure that calls each closure in turn, passing the
* Create a new Closure that calls each closure in turn, passing the
* result into the next closure. The ordering is that of the iterator()
* method on the collection.
*
*
* @param <E> the type that the closure acts on
* @param closures a collection of closures to chain
* @return the <code>chained</code> closure
@ -84,7 +84,7 @@ public class ChainedClosure<E> implements Closure<E>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>chainedClosure</code> if you want that.
*
*
* @param closures the closures to chain, not copied, no nulls
*/
public ChainedClosure(final Closure<? super E>[] closures) {
@ -94,7 +94,7 @@ public class ChainedClosure<E> implements Closure<E>, Serializable {
/**
* Execute a list of closures.
*
*
* @param input the input object passed to each closure
*/
public void execute(final E input) {

View File

@ -54,9 +54,9 @@ public class ChainedTransformer<T> implements Transformer<T, T>, Serializable {
}
return new ChainedTransformer<T>(FunctorUtils.copy(transformers));
}
/**
* Create a new Transformer that calls each transformer in turn, passing the
* Create a new Transformer that calls each transformer in turn, passing the
* result into the next transformer. The ordering is that of the iterator()
* method on the collection.
*
@ -83,7 +83,7 @@ public class ChainedTransformer<T> implements Transformer<T, T>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>chainedTransformer</code> if you want that.
*
*
* @param transformers the transformers to chain, not copied, no nulls
*/
public ChainedTransformer(final Transformer<? super T, ? extends T>[] transformers) {
@ -93,7 +93,7 @@ public class ChainedTransformer<T> implements Transformer<T, T>, Serializable {
/**
* Transforms the input to result via each decorated transformer
*
*
* @param object the input object passed to the first transformer
* @return the transformed result
*/

View File

@ -57,7 +57,7 @@ public class CloneTransformer<T> implements Transformer<T, T>, Serializable {
/**
* Transforms the input to result by cloning it.
*
*
* @param input the input object to transform
* @return the transformed result
*/

View File

@ -54,7 +54,7 @@ public class ClosureTransformer<T> implements Transformer<T, T>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>closureTransformer</code> if you want that.
*
*
* @param closure the closure to call, not null
*/
public ClosureTransformer(final Closure<? super T> closure) {
@ -64,7 +64,7 @@ public class ClosureTransformer<T> implements Transformer<T, T>, Serializable {
/**
* Transforms the input to result by executing a closure.
*
*
* @param input the input object to transform
* @return the transformed result
*/
@ -75,7 +75,7 @@ public class ClosureTransformer<T> implements Transformer<T, T>, Serializable {
/**
* Gets the closure.
*
*
* @return the closure
* @since 3.1
*/

View File

@ -157,7 +157,7 @@ public class ComparatorPredicate<T> implements Predicate<T>, Serializable {
*
* @see org.apache.commons.collections4.Predicate#evaluate(java.lang.Object)
* @see java.util.Comparator#compare(java.lang.Object first, java.lang.Object second)
*
*
* @param target the target object to compare to
* @return {@code true} if the comparison succeeds according to the selected criterion
* @throws IllegalStateException if the criterion is invalid (really not possible)

View File

@ -34,7 +34,7 @@ public class ConstantFactory<T> implements Factory<T>, Serializable {
/** Serial version UID */
private static final long serialVersionUID = -3520677225766901240L;
/** Returns null each time */
public static final Factory<Object> NULL_INSTANCE = new ConstantFactory<Object>(null);
@ -55,11 +55,11 @@ public class ConstantFactory<T> implements Factory<T>, Serializable {
}
return new ConstantFactory<T>(constantToReturn);
}
/**
* Constructor that performs no validation.
* Use <code>constantFactory</code> if you want that.
*
*
* @param constantToReturn the constant to return each time
*/
public ConstantFactory(final T constantToReturn) {
@ -69,7 +69,7 @@ public class ConstantFactory<T> implements Factory<T>, Serializable {
/**
* Always return constant.
*
*
* @return the stored constant value
*/
public T create() {
@ -78,7 +78,7 @@ public class ConstantFactory<T> implements Factory<T>, Serializable {
/**
* Gets the constant.
*
*
* @return the constant
* @since 3.1
*/

View File

@ -34,7 +34,7 @@ public class ConstantTransformer<I, O> implements Transformer<I, O>, Serializabl
/** Serial version UID */
private static final long serialVersionUID = 6374440726369055124L;
/** Returns null each time */
public static final Transformer<Object, Object> NULL_INSTANCE = new ConstantTransformer<Object, Object>(null);
@ -67,11 +67,11 @@ public class ConstantTransformer<I, O> implements Transformer<I, O>, Serializabl
}
return new ConstantTransformer<I, O>(constantToReturn);
}
/**
* Constructor that performs no validation.
* Use <code>constantTransformer</code> if you want that.
*
*
* @param constantToReturn the constant to return each time
*/
public ConstantTransformer(final O constantToReturn) {
@ -81,7 +81,7 @@ public class ConstantTransformer<I, O> implements Transformer<I, O>, Serializabl
/**
* Transforms the input by ignoring it and returning the stored constant instead.
*
*
* @param input the input object which is ignored
* @return the stored constant
*/
@ -91,7 +91,7 @@ public class ConstantTransformer<I, O> implements Transformer<I, O>, Serializabl
/**
* Gets the constant.
*
*
* @return the constant
* @since 3.1
*/

View File

@ -20,7 +20,7 @@ import java.io.Serializable;
/**
* Default {@link Equator} implementation.
*
*
* @param <T> the types of object this {@link Equator} can evaluate.
* @since 4.0
* @version $Id$
@ -40,7 +40,7 @@ public class DefaultEquator<T> implements Equator<T>, Serializable {
/**
* Factory returning the typed singleton instance.
*
*
* @param <T> the object type
* @return the singleton instance
*/
@ -65,7 +65,7 @@ public class DefaultEquator<T> implements Equator<T>, Serializable {
/**
* {@inheritDoc}
*
*
* @return <code>o.hashCode()</code> if <code>o</code> is non-
* <code>null</code>, else {@link #HASHCODE_NULL}.
*/

View File

@ -36,13 +36,13 @@ public final class EqualPredicate<T> implements Predicate<T>, Serializable {
/** The value to compare to */
private final T iValue;
/** The equator to use for comparison */
private final Equator<T> equator;
/**
* Factory to create the predicate.
*
*
* @param <T> the type that the predicate queries
* @param object the object to compare to
* @return the predicate
@ -57,7 +57,7 @@ public final class EqualPredicate<T> implements Predicate<T>, Serializable {
/**
* Factory to create the identity predicate.
*
*
* @param <T> the type that the predicate queries
* @param object the object to compare to
* @param equator the equator to use for comparison
@ -75,7 +75,7 @@ public final class EqualPredicate<T> implements Predicate<T>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>equalPredicate</code> if you want that.
*
*
* @param object the object to compare to
*/
public EqualPredicate(final T object) {
@ -87,7 +87,7 @@ public final class EqualPredicate<T> implements Predicate<T>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>equalPredicate</code> if you want that.
*
*
* @param object the object to compare to
* @param equator the equator to use for comparison
* @since 4.0
@ -100,7 +100,7 @@ public final class EqualPredicate<T> implements Predicate<T>, Serializable {
/**
* Evaluates the predicate returning true if the input equals the stored value.
*
*
* @param object the input object
* @return true if input object equals stored value
*/
@ -114,7 +114,7 @@ public final class EqualPredicate<T> implements Predicate<T>, Serializable {
/**
* Gets the value.
*
*
* @return the value
* @since 3.1
*/

View File

@ -11,14 +11,11 @@
package org.apache.commons.collections4.functors;
/**
* <p>
* An equation function, which determines equality between objects of type T.
* </p>
* <p>
* It is the functional sibling of {@link java.util.Comparator}; {@link Equator} is to
* {@link Object} as {@link java.util.Comparator} is to {@link java.lang.Comparable}.
* </p>
*
*
* @param <T> the types of object this {@link Equator} can evaluate.
* @since 4.0
* @version $Id$
@ -26,7 +23,7 @@ package org.apache.commons.collections4.functors;
public interface Equator<T> {
/**
* Evaluates the two arguments for their equality.
*
*
* @param o1 the first object to be equated.
* @param o2 the second object to be equated.
* @return whether the two objects are equal.
@ -38,7 +35,7 @@ public interface Equator<T> {
* method. This is used for classes that delegate their {@link Object#equals(Object) equals(Object)} method to an
* Equator (and so must also delegate their {@link Object#hashCode() hashCode()} method), or for implementations
* of {@link org.apache.commons.collections4.map.HashedMap} that use an Equator for the key objects.
*
*
* @param o the object to calculate the hash for.
* @return the hash of the object.
*/

View File

@ -37,7 +37,7 @@ public final class ExceptionClosure<E> implements Closure<E>, Serializable {
/**
* Factory returning the singleton instance.
*
*
* @param <E> the type that the closure acts on
* @return the singleton instance
* @since 3.1
@ -56,7 +56,7 @@ public final class ExceptionClosure<E> implements Closure<E>, Serializable {
/**
* Always throw an exception.
*
*
* @param input the input object
* @throws FunctorException always
*/

View File

@ -37,7 +37,7 @@ public final class ExceptionFactory<T> implements Factory<T>, Serializable {
/**
* Factory returning the singleton instance.
*
*
* @param <T> the type the factory creates
* @return the singleton instance
* @since 3.1
@ -56,7 +56,7 @@ public final class ExceptionFactory<T> implements Factory<T>, Serializable {
/**
* Always throws an exception.
*
*
* @return never
* @throws FunctorException always
*/

View File

@ -37,7 +37,7 @@ public class FactoryTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Factory method that performs validation.
*
*
* @param <I> the input type
* @param <O> the output type
* @param factory the factory to call, not null
@ -54,7 +54,7 @@ public class FactoryTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Constructor that performs no validation.
* Use <code>factoryTransformer</code> if you want that.
*
*
* @param factory the factory to call, not null
*/
public FactoryTransformer(final Factory<? extends O> factory) {
@ -65,7 +65,7 @@ public class FactoryTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Transforms the input by ignoring the input and returning the result of
* calling the decorated factory.
*
*
* @param input the input object to transform
* @return the transformed result
*/
@ -75,7 +75,7 @@ public class FactoryTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Gets the factory.
*
*
* @return the factory
* @since 3.1
*/

View File

@ -41,7 +41,7 @@ public class ForClosure<E> implements Closure<E>, Serializable {
* <p>
* A null closure or zero count returns the <code>NOPClosure</code>.
* A count of one returns the specified closure.
*
*
* @param <E> the type that the closure acts on
* @param count the number of times to execute the closure
* @param closure the closure to execute, not null
@ -61,7 +61,7 @@ public class ForClosure<E> implements Closure<E>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>forClosure</code> if you want that.
*
*
* @param count the number of times to execute the closure
* @param closure the closure to execute, not null
*/
@ -73,7 +73,7 @@ public class ForClosure<E> implements Closure<E>, Serializable {
/**
* Executes the closure <code>count</code> times.
*
*
* @param input the input object
*/
public void execute(final E input) {
@ -84,7 +84,7 @@ public class ForClosure<E> implements Closure<E>, Serializable {
/**
* Gets the closure.
*
*
* @return the closure
* @since 3.1
*/
@ -94,7 +94,7 @@ public class ForClosure<E> implements Closure<E>, Serializable {
/**
* Gets the count.
*
*
* @return the count
* @since 3.1
*/

View File

@ -45,7 +45,7 @@ public class IfClosure<E> implements Closure<E>, Serializable {
* <p>
* This factory creates a closure that performs no action when
* the predicate is false.
*
*
* @param <E> the type that the closure acts on
* @param predicate predicate to switch on
* @param trueClosure closure used if true
@ -59,7 +59,7 @@ public class IfClosure<E> implements Closure<E>, Serializable {
/**
* Factory method that performs validation.
*
*
* @param <E> the type that the closure acts on
* @param predicate predicate to switch on
* @param trueClosure closure used if true
@ -85,7 +85,7 @@ public class IfClosure<E> implements Closure<E>, Serializable {
* <p>
* This constructor creates a closure that performs no action when
* the predicate is false.
*
*
* @param predicate predicate to switch on, not null
* @param trueClosure closure used if true, not null
* @since 3.2
@ -97,7 +97,7 @@ public class IfClosure<E> implements Closure<E>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>ifClosure</code> if you want that.
*
*
* @param predicate predicate to switch on, not null
* @param trueClosure closure used if true, not null
* @param falseClosure closure used if false, not null
@ -112,7 +112,7 @@ public class IfClosure<E> implements Closure<E>, Serializable {
/**
* Executes the true or false closure according to the result of the predicate.
*
*
* @param input the input object
*/
public void execute(final E input) {
@ -125,7 +125,7 @@ public class IfClosure<E> implements Closure<E>, Serializable {
/**
* Gets the predicate.
*
*
* @return the predicate
* @since 3.1
*/
@ -135,7 +135,7 @@ public class IfClosure<E> implements Closure<E>, Serializable {
/**
* Gets the closure called when true.
*
*
* @return the closure
* @since 3.1
*/
@ -145,7 +145,7 @@ public class IfClosure<E> implements Closure<E>, Serializable {
/**
* Gets the closure called when false.
*
*
* @return the closure
* @since 3.1
*/

View File

@ -45,7 +45,7 @@ public class InstantiateFactory<T> implements Factory<T>, Serializable {
/**
* Factory method that performs validation.
*
*
* @param <T> the type the factory creates
* @param classToInstantiate the class to instantiate, not null
* @param paramTypes the constructor parameter types, cloned
@ -73,7 +73,7 @@ public class InstantiateFactory<T> implements Factory<T>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>instantiateFactory</code> if you want that.
*
*
* @param classToInstantiate the class to instantiate
*/
public InstantiateFactory(final Class<T> classToInstantiate) {
@ -87,7 +87,7 @@ public class InstantiateFactory<T> implements Factory<T>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>instantiateFactory</code> if you want that.
*
*
* @param classToInstantiate the class to instantiate
* @param paramTypes the constructor parameter types, cloned
* @param args the constructor arguments, cloned
@ -113,7 +113,7 @@ public class InstantiateFactory<T> implements Factory<T>, Serializable {
/**
* Creates an object using the stored constructor.
*
*
* @return the new object
*/
public T create() {
@ -132,5 +132,5 @@ public class InstantiateFactory<T> implements Factory<T>, Serializable {
throw new FunctorException("InstantiateFactory: Constructor threw an exception", ex);
}
}
}

View File

@ -33,7 +33,7 @@ public class InvokerTransformer<I, O> implements Transformer<I, O>, Serializable
/** The serial version */
private static final long serialVersionUID = -8653385846894047688L;
/** The method name to call */
private final String iMethodName;
/** The array of reflection parameter types */
@ -43,7 +43,7 @@ public class InvokerTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Gets an instance of this transformer calling a specific method with no arguments.
*
*
* @param <I> the input type
* @param <O> the output type
* @param methodName the method name to call
@ -88,7 +88,7 @@ public class InvokerTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Constructor for no arg instance.
*
*
* @param methodName the method to call
*/
private InvokerTransformer(final String methodName) {
@ -101,7 +101,7 @@ public class InvokerTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Constructor that performs no validation.
* Use <code>invokerTransformer</code> if you want that.
*
*
* @param methodName the method to call
* @param paramTypes the constructor parameter types, not cloned
* @param args the constructor arguments, not cloned
@ -115,7 +115,7 @@ public class InvokerTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Transforms the input to result by invoking a method on the input.
*
*
* @param input the input object to transform
* @return the transformed result, null if null input
*/

View File

@ -30,13 +30,13 @@ public final class NotPredicate<T> implements Predicate<T>, PredicateDecorator<T
/** Serial version UID */
private static final long serialVersionUID = -2654603322338049674L;
/** The predicate to decorate */
private final Predicate<? super T> iPredicate;
/**
* Factory to create the not predicate.
*
*
* @param <T> the type that the predicate queries
* @param predicate the predicate to decorate, not null
* @return the predicate
@ -52,7 +52,7 @@ public final class NotPredicate<T> implements Predicate<T>, PredicateDecorator<T
/**
* Constructor that performs no validation.
* Use <code>notPredicate</code> if you want that.
*
*
* @param predicate the predicate to call after the null check
*/
public NotPredicate(final Predicate<? super T> predicate) {
@ -62,7 +62,7 @@ public final class NotPredicate<T> implements Predicate<T>, PredicateDecorator<T
/**
* Evaluates the predicate returning the opposite to the stored predicate.
*
*
* @param object the input object
* @return true if predicate returns false
*/
@ -72,7 +72,7 @@ public final class NotPredicate<T> implements Predicate<T>, PredicateDecorator<T
/**
* Gets the predicate being decorated.
*
*
* @return the predicate as the only element in an array
* @since 3.1
*/

View File

@ -31,13 +31,13 @@ public final class NullIsExceptionPredicate<T> implements Predicate<T>, Predicat
/** Serial version UID */
private static final long serialVersionUID = 3243449850504576071L;
/** The predicate to decorate */
private final Predicate<? super T> iPredicate;
/**
* Factory to create the null exception predicate.
*
*
* @param <T> the type that the predicate queries
* @param predicate the predicate to decorate, not null
* @return the predicate
@ -53,7 +53,7 @@ public final class NullIsExceptionPredicate<T> implements Predicate<T>, Predicat
/**
* Constructor that performs no validation.
* Use <code>nullIsExceptionPredicate</code> if you want that.
*
*
* @param predicate the predicate to call after the null check
*/
public NullIsExceptionPredicate(final Predicate<? super T> predicate) {
@ -64,7 +64,7 @@ public final class NullIsExceptionPredicate<T> implements Predicate<T>, Predicat
/**
* Evaluates the predicate returning the result of the decorated predicate
* once a null check is performed.
*
*
* @param object the input object
* @return true if decorated predicate returns true
* @throws FunctorException if input is null
@ -78,7 +78,7 @@ public final class NullIsExceptionPredicate<T> implements Predicate<T>, Predicat
/**
* Gets the predicate being decorated.
*
*
* @return the predicate as the only element in an array
* @since 3.1
*/

View File

@ -30,13 +30,13 @@ public final class NullIsTruePredicate<T> implements Predicate<T>, PredicateDeco
/** Serial version UID */
private static final long serialVersionUID = -7625133768987126273L;
/** The predicate to decorate */
private final Predicate<? super T> iPredicate;
/**
* Factory to create the null true predicate.
*
*
* @param <T> the type that the predicate queries
* @param predicate the predicate to decorate, not null
* @return the predicate
@ -52,7 +52,7 @@ public final class NullIsTruePredicate<T> implements Predicate<T>, PredicateDeco
/**
* Constructor that performs no validation.
* Use <code>nullIsTruePredicate</code> if you want that.
*
*
* @param predicate the predicate to call after the null check
*/
public NullIsTruePredicate(final Predicate<? super T> predicate) {
@ -63,7 +63,7 @@ public final class NullIsTruePredicate<T> implements Predicate<T>, PredicateDeco
/**
* Evaluates the predicate returning the result of the decorated predicate
* once a null check is performed.
*
*
* @param object the input object
* @return true if decorated predicate returns true or input is null
*/
@ -76,7 +76,7 @@ public final class NullIsTruePredicate<T> implements Predicate<T>, PredicateDeco
/**
* Gets the predicate being decorated.
*
*
* @return the predicate as the only element in an array
* @since 3.1
*/

View File

@ -36,7 +36,7 @@ public final class OnePredicate<T> extends AbstractQuantifierPredicate<T> implem
/** Serial version UID */
private static final long serialVersionUID = -8125389089924745785L;
/**
* Factory to create the predicate.
* <p>
@ -78,7 +78,7 @@ public final class OnePredicate<T> extends AbstractQuantifierPredicate<T> implem
/**
* Constructor that performs no validation.
* Use <code>onePredicate</code> if you want that.
*
*
* @param predicates the predicates to check, not cloned, not null
*/
public OnePredicate(final Predicate<? super T>[] predicates) {
@ -88,7 +88,7 @@ public final class OnePredicate<T> extends AbstractQuantifierPredicate<T> implem
/**
* Evaluates the predicate returning true if only one decorated predicate
* returns true.
*
*
* @param object the input object
* @return true if only one decorated predicate returns true
*/

View File

@ -33,7 +33,7 @@ public interface PredicateDecorator<T> extends Predicate<T> {
* <p>
* The array may be the internal data structure of the predicate and thus
* should not be altered.
*
*
* @return the predicates being decorated
*/
Predicate<? super T>[] getPredicates();

View File

@ -38,7 +38,7 @@ public class PredicateTransformer<T> implements Transformer<T, Boolean>, Seriali
/**
* Factory method that performs validation.
*
*
* @param <T> the input type
* @param predicate the predicate to call, not null
* @return the <code>predicate</code> transformer
@ -54,7 +54,7 @@ public class PredicateTransformer<T> implements Transformer<T, Boolean>, Seriali
/**
* Constructor that performs no validation.
* Use <code>predicateTransformer</code> if you want that.
*
*
* @param predicate the predicate to call, not null
*/
public PredicateTransformer(final Predicate<? super T> predicate) {
@ -64,7 +64,7 @@ public class PredicateTransformer<T> implements Transformer<T, Boolean>, Seriali
/**
* Transforms the input to result by calling a predicate.
*
*
* @param input the input object to transform
* @return the transformed result
*/
@ -74,7 +74,7 @@ public class PredicateTransformer<T> implements Transformer<T, Boolean>, Seriali
/**
* Gets the predicate.
*
*
* @return the predicate
* @since 3.1
*/

View File

@ -92,10 +92,10 @@ public class PrototypeFactory {
* PrototypeCloneFactory creates objects by copying a prototype using the clone method.
*/
static class PrototypeCloneFactory<T> implements Factory<T>, Serializable {
/** The serial version */
private static final long serialVersionUID = 5604271422565175555L;
/** The object to clone each time */
private final T iPrototype;
/** The method used to clone */
@ -123,7 +123,7 @@ public class PrototypeFactory {
/**
* Creates an object by calling the clone method.
*
*
* @return the new object
*/
@SuppressWarnings("unchecked")
@ -149,10 +149,10 @@ public class PrototypeFactory {
* PrototypeSerializationFactory creates objects by cloning a prototype using serialization.
*/
static class PrototypeSerializationFactory<T extends Serializable> implements Factory<T>, Serializable {
/** The serial version */
private static final long serialVersionUID = -8704966966139178833L;
/** The object to clone via serialization each time */
private final T iPrototype;
@ -166,7 +166,7 @@ public class PrototypeFactory {
/**
* Creates an object using serialization.
*
*
* @return the new object
*/
@SuppressWarnings("unchecked")

View File

@ -43,7 +43,7 @@ public class SwitchTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Factory method that performs validation and copies the parameter arrays.
*
*
* @param <I> the input type
* @param <O> the output type
* @param predicates array of predicates, cloned, no nulls
@ -72,16 +72,16 @@ public class SwitchTransformer<I, O> implements Transformer<I, O>, Serializable
}
/**
* Create a new Transformer that calls one of the transformers depending
* on the predicates.
* Create a new Transformer that calls one of the transformers depending
* on the predicates.
* <p>
* The Map consists of Predicate keys and Transformer values. A transformer
* The Map consists of Predicate keys and Transformer values. A transformer
* is called if its matching predicate returns true. Each predicate is evaluated
* until one returns true. If no predicates evaluate to true, the default
* transformer is called. The default transformer is set in the map with a
* null key. The ordering is that of the iterator() method on the entryset
* transformer is called. The default transformer is set in the map with a
* null key. The ordering is that of the iterator() method on the entryset
* collection of the map.
*
*
* @param <I> the input type
* @param <O> the output type
* @param map a map of predicates to transformers
@ -118,11 +118,11 @@ public class SwitchTransformer<I, O> implements Transformer<I, O>, Serializable
}
return new SwitchTransformer<I, O>(preds, transformers, defaultTransformer);
}
/**
* Constructor that performs no validation.
* Use <code>switchTransformer</code> if you want that.
*
*
* @param predicates array of predicates, not cloned, no nulls
* @param transformers matching array of transformers, not cloned, no nulls
* @param defaultTransformer the transformer to use if no match, null means return null
@ -141,7 +141,7 @@ public class SwitchTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Transforms the input to result by calling the transformer whose matching
* predicate returns true.
*
*
* @param input the input object to transform
* @return the transformed result
*/
@ -156,7 +156,7 @@ public class SwitchTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Gets the predicates.
*
*
* @return a copy of the predicates
* @since 3.1
*/
@ -166,7 +166,7 @@ public class SwitchTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Gets the transformers.
*
*
* @return a copy of the transformers
* @since 3.1
*/
@ -176,7 +176,7 @@ public class SwitchTransformer<I, O> implements Transformer<I, O>, Serializable
/**
* Gets the default transformer.
*
*
* @return the default transformer
* @since 3.1
*/

View File

@ -40,7 +40,7 @@ public class TransformerClosure<E> implements Closure<E>, Serializable {
* Factory method that performs validation.
* <p>
* A null transformer will return the <code>NOPClosure</code>.
*
*
* @param <E> the type that the closure acts on
* @param transformer the transformer to call, null means nop
* @return the <code>transformer</code> closure
@ -55,7 +55,7 @@ public class TransformerClosure<E> implements Closure<E>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>transformerClosure</code> if you want that.
*
*
* @param transformer the transformer to call, not null
*/
public TransformerClosure(final Transformer<? super E, ?> transformer) {
@ -65,7 +65,7 @@ public class TransformerClosure<E> implements Closure<E>, Serializable {
/**
* Executes the closure by calling the decorated transformer.
*
*
* @param input the input object
*/
public void execute(final E input) {
@ -74,7 +74,7 @@ public class TransformerClosure<E> implements Closure<E>, Serializable {
/**
* Gets the transformer.
*
*
* @return the transformer
* @since 3.1
*/

View File

@ -42,7 +42,7 @@ public class WhileClosure<E> implements Closure<E>, Serializable {
/**
* Factory method that performs validation.
*
*
* @param <E> the type that the closure acts on
* @param predicate the predicate used to evaluate when the loop terminates, not null
* @param closure the closure the execute, not null
@ -64,7 +64,7 @@ public class WhileClosure<E> implements Closure<E>, Serializable {
/**
* Constructor that performs no validation.
* Use <code>whileClosure</code> if you want that.
*
*
* @param predicate the predicate used to evaluate when the loop terminates, not null
* @param closure the closure the execute, not null
* @param doLoop true to act as a do-while loop, always executing the closure once
@ -78,7 +78,7 @@ public class WhileClosure<E> implements Closure<E>, Serializable {
/**
* Executes the closure until the predicate is false.
*
*
* @param input the input object
*/
public void execute(final E input) {
@ -92,7 +92,7 @@ public class WhileClosure<E> implements Closure<E>, Serializable {
/**
* Gets the predicate in use.
*
*
* @return the predicate
* @since 3.1
*/
@ -102,7 +102,7 @@ public class WhileClosure<E> implements Closure<E>, Serializable {
/**
* Gets the closure.
*
*
* @return the closure
* @since 3.1
*/
@ -112,7 +112,7 @@ public class WhileClosure<E> implements Closure<E>, Serializable {
/**
* Is the loop a do-while loop.
*
*
* @return true is do-while, false if while
* @since 3.1
*/

View File

@ -21,7 +21,7 @@
* {@link org.apache.commons.collections4.Transformer Transformer} and
* {@link org.apache.commons.collections4.Factory Factory} interfaces.
* These provide simple callbacks for processing with collections.
*
*
* @version $Id$
*/
package org.apache.commons.collections4.functors;