bayard 2002/11/06 11:16:33
Modified: lang/src/java/org/apache/commons/lang/functor
TransformerUtils.java
Log:
Closure renamed to Executor
Revision Changes Path
1.2 +15 -15
jakarta-commons/lang/src/java/org/apache/commons/lang/functor/TransformerUtils.java
Index: TransformerUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/functor/TransformerUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TransformerUtils.java 5 Nov 2002 16:44:28 -0000 1.1
+++ TransformerUtils.java 6 Nov 2002 19:16:33 -0000 1.2
@@ -67,7 +67,7 @@
* <li>Invoker - returns the result of a method call on the input object
* <li>Clone - returns a clone of the input object
* <li>Constant - always returns the same object
- * <li>Closure - performs a Closure and returns the input object
+ * <li>Executor - performs a Executor and returns the input object
* <li>Predicate - returns the result of the predicate as a Boolean
* <li>Factory - returns a new object from a factory
* <li>Chained - chains two or more transformers together
@@ -172,17 +172,17 @@
}
/**
- * Creates a Transformer that calls a Closure each time the transformer is used.
+ * Creates a Transformer that calls a Executor each time the transformer is
used.
* The transformer returns the input object.
*
* @param command the command to run each time in the transformer
* @return the transformer.
*/
- public static Transformer asTransformer(Closure command) {
+ public static Transformer asTransformer(Executor command) {
if (command == null) {
- throw new IllegalArgumentException("ClosureTransformer: The command
must not be null");
+ throw new IllegalArgumentException("ExecutorTransformer: The command
must not be null");
}
- return new ClosureTransformer(command);
+ return new ExecutorTransformer(command);
}
/**
@@ -655,22 +655,22 @@
}
}
- // ClosureTransformer
+ // ExecutorTransformer
//----------------------------------------------------------------------------------
/**
- * ClosureTransformer executes a Closure object.
+ * ExecutorTransformer executes a Executor object.
*/
- private static class ClosureTransformer implements Transformer, Serializable {
+ private static class ExecutorTransformer implements Transformer, Serializable {
- private final Closure iClosure;
+ private final Executor iExecutor;
/**
* Constructor to store command
*/
- private ClosureTransformer(Closure command) {
+ private ExecutorTransformer(Executor command) {
super();
- iClosure = command;
+ iExecutor = command;
}
/**
@@ -678,11 +678,11 @@
*/
public Object transform(Object input) {
try {
- iClosure.execute(input);
+ iExecutor.execute(input);
return input;
- } catch (ClosureException ex) {
- throw new TransformerException("ClosureTransformer: " +
ex.getMessage(), ex);
+ } catch (ExecutorException ex) {
+ throw new TransformerException("ExecutorTransformer: " +
ex.getMessage(), ex);
}
}
}
--
To unsubscribe, e-mail: <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>