Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2013-08-20 22:05:56 +0000
committerBrian Vosburgh2013-08-26 19:14:17 +0000
commitb7f4808580b8ba3e394cb77a7852377731c2cfd6 (patch)
treeff755967348657623d62496d1f461d47da9ed49c
parent85753558ebe90ec72de006ab11f1b54eeaedba83 (diff)
downloadwebtools.dali-b7f4808580b8ba3e394cb77a7852377731c2cfd6.tar.gz
webtools.dali-b7f4808580b8ba3e394cb77a7852377731c2cfd6.tar.xz
webtools.dali-b7f4808580b8ba3e394cb77a7852377731c2cfd6.zip
rename ParameterizedCommand to Closure
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/closure/Closure.java (renamed from common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/ParameterizedCommand.java)6
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/closure/InterruptibleClosure.java (renamed from common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleParameterizedCommand.java)6
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/Command.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/Factory.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ArrayTools.java32
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/ClosureAdapter.java (renamed from common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/ParameterizedCommandAdapter.java)18
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/ClosureWrapper.java52
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/DisabledClosure.java (renamed from common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/DisabledParameterizedCommand.java)18
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptedClosure.java (renamed from common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptedParameterizedCommand.java)19
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptibleClosureAdapter.java (renamed from common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptibleParameterizedCommandAdapter.java)18
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptibleClosureWrapper.java52
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/NullClosure.java (renamed from common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/NullParameterizedCommand.java)19
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptibleParameterizedCommandWrapper.java51
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/ParameterizedCommandWrapper.java51
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/CloneIterable.java10
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/IterableTools.java50
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/LiveCloneIterable.java10
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/SnapshotCloneIterable.java14
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/CloneIterator.java24
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/IteratorTools.java42
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/jdbc/ResultSetCommand.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerWrapper.java1
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java4
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java16
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/CloneIterableTests.java6
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/IterableToolsTests.java12
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/CloneIteratorTests.java6
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/IteratorToolsTests.java12
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java4
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java4
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java4
34 files changed, 296 insertions, 277 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/ParameterizedCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/closure/Closure.java
index ae9d8b408b..db43ab069a 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/ParameterizedCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/closure/Closure.java
@@ -7,7 +7,7 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.common.utility.command;
+package org.eclipse.jpt.common.utility.closure;
/**
* Simple interface for implementing a command that takes a single argument.
@@ -24,8 +24,8 @@ package org.eclipse.jpt.common.utility.command;
* @see org.eclipse.jpt.common.utility.factory.Factory
* @see org.eclipse.jpt.common.utility.transformer.Transformer
*/
-public interface ParameterizedCommand<A>
- extends InterruptibleParameterizedCommand<A>
+public interface Closure<A>
+ extends InterruptibleClosure<A>
{
/**
* Execute the command. The semantics of the command
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleParameterizedCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/closure/InterruptibleClosure.java
index f30de9b8f9..eb6cafe6f6 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleParameterizedCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/closure/InterruptibleClosure.java
@@ -7,7 +7,7 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.common.utility.command;
+package org.eclipse.jpt.common.utility.closure;
/**
* Simple interface for implementing a command that takes a single argument
@@ -21,12 +21,12 @@ package org.eclipse.jpt.common.utility.command;
*
* @param <A> the type of the object passed to the command
*
- * @see ParameterizedCommand
+ * @see Closure
* @see org.eclipse.jpt.common.utility.command.InterruptibleCommand
* @see org.eclipse.jpt.common.utility.factory.InterruptibleFactory
* @see org.eclipse.jpt.common.utility.transformer.InterruptibleTransformer
*/
-public interface InterruptibleParameterizedCommand<A> {
+public interface InterruptibleClosure<A> {
/**
* Execute the command. The semantics of the command
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/Command.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/Command.java
index 66ce37e71f..6f34ee2441 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/Command.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/Command.java
@@ -19,7 +19,7 @@ package org.eclipse.jpt.common.utility.command;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @see org.eclipse.jpt.common.utility.command.ParameterizedCommand
+ * @see org.eclipse.jpt.common.utility.closure.Closure
* @see org.eclipse.jpt.common.utility.factory.Factory
* @see org.eclipse.jpt.common.utility.transformer.Transformer
*/
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java
index 6953faa23c..82ea00c29f 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java
@@ -20,7 +20,7 @@ package org.eclipse.jpt.common.utility.command;
* will almost certainly be broken (repeatedly) as the API evolves.
*
* @see Command
- * @see org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand
+ * @see org.eclipse.jpt.common.utility.closure.InterruptibleClosure
* @see org.eclipse.jpt.common.utility.factory.InterruptibleFactory
* @see org.eclipse.jpt.common.utility.transformer.InterruptibleTransformer
*/
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/Factory.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/Factory.java
index 15c93099b9..704abaf40a 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/Factory.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/Factory.java
@@ -21,7 +21,7 @@ package org.eclipse.jpt.common.utility.factory;
* @param <T> the type of the object created by the factory
*
* @see org.eclipse.jpt.common.utility.command.Command
- * @see org.eclipse.jpt.common.utility.command.ParameterizedCommand
+ * @see org.eclipse.jpt.common.utility.closure.Closure
* @see org.eclipse.jpt.common.utility.transformer.Transformer
*/
public interface Factory<T>
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java
index abb0b8e550..a4c744ced3 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java
@@ -22,7 +22,7 @@ package org.eclipse.jpt.common.utility.factory;
* @param <T> the type of the object created by the factory
*
* @see Factory
- * @see org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand
+ * @see org.eclipse.jpt.common.utility.closure.InterruptibleClosure
* @see org.eclipse.jpt.common.utility.command.InterruptibleCommand
* @see org.eclipse.jpt.common.utility.transformer.InterruptibleTransformer
*/
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ArrayTools.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ArrayTools.java
index da2444c1d3..935ae8c1c2 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ArrayTools.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ArrayTools.java
@@ -17,8 +17,8 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Random;
-import org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
+import org.eclipse.jpt.common.utility.closure.InterruptibleClosure;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
import org.eclipse.jpt.common.utility.internal.collection.ListTools;
@@ -3071,24 +3071,24 @@ public final class ArrayTools {
// ********** execute **********
/**
- * Execute the specified command for each element in the specified array.
+ * Execute the specified closure for each element in the specified array.
*/
- public static <E> void execute(E[] array, ParameterizedCommand<E> command) {
+ public static <E> void execute(E[] array, Closure<E> closure) {
for (E e : array) {
- command.execute(e);
+ closure.execute(e);
}
}
/**
- * Execute the specified command for each element in the specified array.
- * If the command throws an exception for an element, the exception will be
+ * Execute the specified closure for each element in the specified array.
+ * If the closure throws an exception for an element, the exception will be
* handled by the specified exception handler and processing of the
* remaining elements will continue.
*/
- public static <E> void execute(E[] array, ParameterizedCommand<E> command, ExceptionHandler exceptionHandler) {
+ public static <E> void execute(E[] array, Closure<E> closure, ExceptionHandler exceptionHandler) {
for (E e : array) {
try {
- command.execute(e);
+ closure.execute(e);
} catch (Throwable ex) {
exceptionHandler.handleException(ex);
}
@@ -3096,25 +3096,25 @@ public final class ArrayTools {
}
/**
- * Execute the specified command for each element in the specified array.
+ * Execute the specified closure for each element in the specified array.
*/
- public static <E> void execute(E[] array, InterruptibleParameterizedCommand<E> command) throws InterruptedException {
+ public static <E> void execute(E[] array, InterruptibleClosure<E> closure) throws InterruptedException {
for (E e : array) {
- command.execute(e);
+ closure.execute(e);
}
}
/**
- * Execute the specified command for each element in the specified array.
- * If the command throws an exception (other than an
+ * Execute the specified closure for each element in the specified array.
+ * If the closure throws an exception (other than an
* {@link InterruptedException}) for an element, the exception will be
* handled by the specified exception handler and processing of the
* remaining elements will continue.
*/
- public static <E> void execute(E[] array, InterruptibleParameterizedCommand<E> command, ExceptionHandler exceptionHandler) throws InterruptedException {
+ public static <E> void execute(E[] array, InterruptibleClosure<E> closure, ExceptionHandler exceptionHandler) throws InterruptedException {
for (E e : array) {
try {
- command.execute(e);
+ closure.execute(e);
} catch (InterruptedException ex) {
throw ex;
} catch (Throwable ex) {
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/ParameterizedCommandAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/ClosureAdapter.java
index b982b9ea4b..064123e706 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/ParameterizedCommandAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/ClosureAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -7,18 +7,22 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.command;
+package org.eclipse.jpt.common.utility.internal.closure;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
/**
- * Convenience command that does nothing.
+ * Convenience closure that does nothing.
+ *
+ * @param <A> the type of the object passed to the closure
+ *
+ * @see NullClosure
*/
-public class ParameterizedCommandAdapter<E>
- implements ParameterizedCommand<E>
+public class ClosureAdapter<A>
+ implements Closure<A>
{
- public void execute(E argument) {
+ public void execute(A argument) {
// NOP
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/ClosureWrapper.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/ClosureWrapper.java
new file mode 100644
index 0000000000..35a1b8e3ca
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/ClosureWrapper.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.internal.closure;
+
+import org.eclipse.jpt.common.utility.closure.Closure;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+
+/**
+ * Closure wrapper that can have its wrapped closure changed,
+ * allowing a client to change a previously-supplied closure's
+ * behavior mid-stream.
+ *
+ * @param <A> the type of the object passed to the closure
+ *
+ * @see #setClosure(Closure)
+ */
+public class ClosureWrapper<A>
+ implements Closure<A>
+{
+ protected volatile Closure<? super A> closure;
+
+ public ClosureWrapper(Closure<? super A> closure) {
+ super();
+ if (closure == null) {
+ throw new NullPointerException();
+ }
+ this.closure = closure;
+ }
+
+ public void execute(A argument) {
+ this.closure.execute(argument);
+ }
+
+ public void setClosure(Closure<? super A> closure) {
+ if (closure == null) {
+ throw new NullPointerException();
+ }
+ this.closure = closure;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this, this.closure);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/DisabledParameterizedCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/DisabledClosure.java
index ae6fced2f9..a85a7d2eb3 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/DisabledParameterizedCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/DisabledClosure.java
@@ -7,29 +7,31 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.command;
+package org.eclipse.jpt.common.utility.internal.closure;
import java.io.Serializable;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
/**
- * Singleton implementation of the command interface that will throw an
+ * Closure that will throw an
* {@link UnsupportedOperationException exception} when executed.
+ *
+ * @param <A> the type of the object passed to the closure
*/
-public final class DisabledParameterizedCommand<A>
- implements ParameterizedCommand<A>, Serializable
+public final class DisabledClosure<A>
+ implements Closure<A>, Serializable
{
@SuppressWarnings("rawtypes")
- public static final ParameterizedCommand INSTANCE = new DisabledParameterizedCommand();
+ public static final Closure INSTANCE = new DisabledClosure();
@SuppressWarnings("unchecked")
- public static <A> ParameterizedCommand<A> instance() {
+ public static <A> Closure<A> instance() {
return INSTANCE;
}
// ensure single instance
- private DisabledParameterizedCommand() {
+ private DisabledClosure() {
super();
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptedParameterizedCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptedClosure.java
index 5c1ce84ec8..8d34cc7994 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptedParameterizedCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptedClosure.java
@@ -7,30 +7,31 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.command;
+package org.eclipse.jpt.common.utility.internal.closure;
import java.io.Serializable;
-import org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.InterruptibleClosure;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
/**
- * Singleton implementation of the interruptible parameterized command
- * interface that will throw an {@link InterruptedException exception}
+ * Closure that will throw an {@link InterruptedException exception}
* when executed.
+ *
+ * @param <A> the type of the object passed to the closure
*/
-public final class InterruptedParameterizedCommand<A>
- implements InterruptibleParameterizedCommand<A>, Serializable
+public final class InterruptedClosure<A>
+ implements InterruptibleClosure<A>, Serializable
{
@SuppressWarnings("rawtypes")
- public static final InterruptibleParameterizedCommand INSTANCE = new InterruptedParameterizedCommand();
+ public static final InterruptibleClosure INSTANCE = new InterruptedClosure();
@SuppressWarnings("unchecked")
- public static <A> InterruptibleParameterizedCommand<A> instance() {
+ public static <A> InterruptibleClosure<A> instance() {
return INSTANCE;
}
// ensure single instance
- private InterruptedParameterizedCommand() {
+ private InterruptedClosure() {
super();
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptibleParameterizedCommandAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptibleClosureAdapter.java
index 25bd7c4297..22bd024134 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptibleParameterizedCommandAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptibleClosureAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -7,18 +7,22 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.command;
+package org.eclipse.jpt.common.utility.internal.closure;
-import org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.InterruptibleClosure;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
/**
- * Convenience command that does nothing.
+ * Convenience closure that does nothing.
+ *
+ * @param <A> the type of the object passed to the closure
+ *
+ * @see NullClosure
*/
-public class InterruptibleParameterizedCommandAdapter<E>
- implements InterruptibleParameterizedCommand<E>
+public class InterruptibleClosureAdapter<A>
+ implements InterruptibleClosure<A>
{
- public void execute(E argument) throws InterruptedException {
+ public void execute(A argument) throws InterruptedException {
// NOP
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptibleClosureWrapper.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptibleClosureWrapper.java
new file mode 100644
index 0000000000..e3037bb653
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/InterruptibleClosureWrapper.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.internal.closure;
+
+import org.eclipse.jpt.common.utility.closure.InterruptibleClosure;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+
+/**
+ * closure wrapper that can have its wrapped closure changed,
+ * allowing a client to change a previously-supplied closure's
+ * behavior mid-stream.
+ *
+ * @param <A> the type of the object passed to the closure
+ *
+ * @see #setClosure(InterruptibleClosure)
+ */
+public class InterruptibleClosureWrapper<A>
+ implements InterruptibleClosure<A>
+{
+ protected volatile InterruptibleClosure<? super A> closure;
+
+ public InterruptibleClosureWrapper(InterruptibleClosure<? super A> closure) {
+ super();
+ if (closure == null) {
+ throw new NullPointerException();
+ }
+ this.closure = closure;
+ }
+
+ public void execute(A argument) throws InterruptedException {
+ this.closure.execute(argument);
+ }
+
+ public void setClosure(InterruptibleClosure<? super A> closure) {
+ if (closure == null) {
+ throw new NullPointerException();
+ }
+ this.closure = closure;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this, this.closure);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/NullParameterizedCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/NullClosure.java
index 12b83c946e..1f147bcdb5 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/NullParameterizedCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/closure/NullClosure.java
@@ -7,29 +7,30 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.command;
+package org.eclipse.jpt.common.utility.internal.closure;
import java.io.Serializable;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
/**
- * Singleton implementation of the command interface that will do nothing
- * when executed.
+ * Closure that will do nothing when executed.
+ *
+ * @param <A> the type of the object passed to the closure
*/
-public final class NullParameterizedCommand<A>
- implements ParameterizedCommand<A>, Serializable
+public final class NullClosure<A>
+ implements Closure<A>, Serializable
{
@SuppressWarnings("rawtypes")
- public static final ParameterizedCommand INSTANCE = new NullParameterizedCommand();
+ public static final Closure INSTANCE = new NullClosure();
@SuppressWarnings("unchecked")
- public static <A> ParameterizedCommand<A> instance() {
+ public static <A> Closure<A> instance() {
return INSTANCE;
}
// ensure single instance
- private NullParameterizedCommand() {
+ private NullClosure() {
super();
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptibleParameterizedCommandWrapper.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptibleParameterizedCommandWrapper.java
deleted file mode 100644
index 2311e4ce9f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/InterruptibleParameterizedCommandWrapper.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.command;
-
-import org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand;
-import org.eclipse.jpt.common.utility.internal.ObjectTools;
-
-/**
- * Command wrapper that can have its wrapped command changed,
- * allowing a client to change a previously-supplied command's
- * behavior mid-stream.
- *
- * @param <T> the type of the object passed to the command
- * @see #setCommand(InterruptibleParameterizedCommand)
- */
-public class InterruptibleParameterizedCommandWrapper<T>
- implements InterruptibleParameterizedCommand<T>
-{
- protected volatile InterruptibleParameterizedCommand<? super T> command;
-
- public InterruptibleParameterizedCommandWrapper(InterruptibleParameterizedCommand<? super T> command) {
- super();
- if (command == null) {
- throw new NullPointerException();
- }
- this.command = command;
- }
-
- public void execute(T argument) throws InterruptedException {
- this.command.execute(argument);
- }
-
- public void setCommand(InterruptibleParameterizedCommand<? super T> command) {
- if (command == null) {
- throw new NullPointerException();
- }
- this.command = command;
- }
-
- @Override
- public String toString() {
- return ObjectTools.toString(this, this.command);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/ParameterizedCommandWrapper.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/ParameterizedCommandWrapper.java
deleted file mode 100644
index c5f6fa8078..0000000000
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/command/ParameterizedCommandWrapper.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.command;
-
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
-import org.eclipse.jpt.common.utility.internal.ObjectTools;
-
-/**
- * Command wrapper that can have its wrapped command changed,
- * allowing a client to change a previously-supplied command's
- * behavior mid-stream.
- *
- * @param <T> the type of the object passed to the command
- * @see #setCommand(ParameterizedCommand)
- */
-public class ParameterizedCommandWrapper<T>
- implements ParameterizedCommand<T>
-{
- protected volatile ParameterizedCommand<? super T> command;
-
- public ParameterizedCommandWrapper(ParameterizedCommand<? super T> command) {
- super();
- if (command == null) {
- throw new NullPointerException();
- }
- this.command = command;
- }
-
- public void execute(T argument) {
- this.command.execute(argument);
- }
-
- public void setCommand(ParameterizedCommand<? super T> command) {
- if (command == null) {
- throw new NullPointerException();
- }
- this.command = command;
- }
-
- @Override
- public String toString() {
- return ObjectTools.toString(this, this.command);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/CloneIterable.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/CloneIterable.java
index dabf433985..c1595aecf6 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/CloneIterable.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/CloneIterable.java
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.common.utility.internal.iterable;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
/**
* Pull together remover state and behavior for subclasses.
@@ -22,14 +22,14 @@ import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
public abstract class CloneIterable<E>
implements Iterable<E>
{
- final ParameterizedCommand<? super E> removeCommand;
+ final Closure<? super E> removeClosure;
- protected CloneIterable(ParameterizedCommand<? super E> removeCommand) {
+ protected CloneIterable(Closure<? super E> removeClosure) {
super();
- if (removeCommand == null) {
+ if (removeClosure == null) {
throw new NullPointerException();
}
- this.removeCommand = removeCommand;
+ this.removeClosure = removeClosure;
}
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/IterableTools.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/IterableTools.java
index 93fc1cc7f9..f7d0179e40 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/IterableTools.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/IterableTools.java
@@ -16,15 +16,15 @@ import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
+import org.eclipse.jpt.common.utility.closure.Closure;
+import org.eclipse.jpt.common.utility.closure.InterruptibleClosure;
import org.eclipse.jpt.common.utility.collection.Queue;
import org.eclipse.jpt.common.utility.collection.Stack;
-import org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
+import org.eclipse.jpt.common.utility.internal.closure.DisabledClosure;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
import org.eclipse.jpt.common.utility.internal.collection.HashBag;
import org.eclipse.jpt.common.utility.internal.collection.ListTools;
-import org.eclipse.jpt.common.utility.internal.command.DisabledParameterizedCommand;
import org.eclipse.jpt.common.utility.internal.iterator.CloneListIterator;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateTools;
@@ -188,38 +188,38 @@ public final class IterableTools {
}
/**
- * Execute the specified command for each element in the specified iterable.
+ * Execute the specified closure for each element in the specified iterable.
*/
- public static <E> void execute(Iterable<? extends E> iterable, ParameterizedCommand<E> command) {
- IteratorTools.execute(iterable.iterator(), command);
+ public static <E> void execute(Iterable<? extends E> iterable, Closure<E> closure) {
+ IteratorTools.execute(iterable.iterator(), closure);
}
/**
- * Execute the specified command for each element in the specified iterable.
- * If the command throws an exception for an element, the exception will be
+ * Execute the specified closure for each element in the specified iterable.
+ * If the closure throws an exception for an element, the exception will be
* handled by the specified exception handler and processing of the
* remaining elements will continue.
*/
- public static <E> void execute(Iterable<? extends E> iterable, ParameterizedCommand<E> command, ExceptionHandler exceptionHandler) {
- IteratorTools.execute(iterable.iterator(), command, exceptionHandler);
+ public static <E> void execute(Iterable<? extends E> iterable, Closure<E> closure, ExceptionHandler exceptionHandler) {
+ IteratorTools.execute(iterable.iterator(), closure, exceptionHandler);
}
/**
- * Execute the specified command for each element in the specified iterable.
+ * Execute the specified closure for each element in the specified iterable.
*/
- public static <E> void execute(Iterable<? extends E> iterable, InterruptibleParameterizedCommand<E> command) throws InterruptedException {
- IteratorTools.execute(iterable.iterator(), command);
+ public static <E> void execute(Iterable<? extends E> iterable, InterruptibleClosure<E> closure) throws InterruptedException {
+ IteratorTools.execute(iterable.iterator(), closure);
}
/**
- * Execute the specified command for each element in the specified iterable.
- * If the command throws an exception (other than an
+ * Execute the specified closure for each element in the specified iterable.
+ * If the closure throws an exception (other than an
* {@link InterruptedException}) for an element, the exception will be
* handled by the specified exception handler and processing of the
* remaining elements will continue.
*/
- public static <E> void execute(Iterable<? extends E> iterable, InterruptibleParameterizedCommand<E> command, ExceptionHandler exceptionHandler) throws InterruptedException {
- IteratorTools.execute(iterable.iterator(), command, exceptionHandler);
+ public static <E> void execute(Iterable<? extends E> iterable, InterruptibleClosure<E> closure, ExceptionHandler exceptionHandler) throws InterruptedException {
+ IteratorTools.execute(iterable.iterator(), closure, exceptionHandler);
}
/**
@@ -510,16 +510,16 @@ public final class IterableTools {
* @see LiveCloneIterable
*/
public static <E> LiveCloneIterable<E> cloneLive(Collection<? extends E> collection) {
- return cloneLive(collection, DisabledParameterizedCommand.instance());
+ return cloneLive(collection, DisabledClosure.instance());
}
/**
* Return an iterable that clones the specified collection before returning
- * elements and uses the specified remove command.
+ * elements and uses the specified remove closure.
* @see LiveCloneIterable
*/
- public static <E> LiveCloneIterable<E> cloneLive(Collection<? extends E> collection, ParameterizedCommand<? super E> removeCommand) {
- return new LiveCloneIterable<E>(collection, removeCommand);
+ public static <E> LiveCloneIterable<E> cloneLive(Collection<? extends E> collection, Closure<? super E> removeClosure) {
+ return new LiveCloneIterable<E>(collection, removeClosure);
}
/**
@@ -546,16 +546,16 @@ public final class IterableTools {
* @see SnapshotCloneIterable
*/
public static <E> SnapshotCloneIterable<E> cloneSnapshot(Collection<? extends E> collection) {
- return cloneSnapshot(collection, DisabledParameterizedCommand.instance());
+ return cloneSnapshot(collection, DisabledClosure.instance());
}
/**
* Return an iterable that clones the specified collection before returning
- * elements and uses the specified remove command.
+ * elements and uses the specified remove closure.
* @see LiveCloneIterable
*/
- public static <E> SnapshotCloneIterable<E> cloneSnapshot(Collection<? extends E> collection, ParameterizedCommand<? super E> removeCommand) {
- return new SnapshotCloneIterable<E>(collection, removeCommand);
+ public static <E> SnapshotCloneIterable<E> cloneSnapshot(Collection<? extends E> collection, Closure<? super E> removeClosure) {
+ return new SnapshotCloneIterable<E>(collection, removeClosure);
}
/**
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/LiveCloneIterable.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/LiveCloneIterable.java
index 5c66ee5f02..c1677d045b 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/LiveCloneIterable.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/LiveCloneIterable.java
@@ -11,7 +11,7 @@ package org.eclipse.jpt.common.utility.internal.iterable;
import java.util.Collection;
import java.util.Iterator;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.iterator.CloneIterator;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
@@ -29,7 +29,7 @@ import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
* By default, the iterator returned by a <code>LiveCloneIterable</code> does not
* support the {@link Iterator#remove()} operation; this is because it does not
* have access to the original collection. But if the <code>LiveCloneIterable</code>
- * is supplied with an {@link ParameterizedCommand remove command} it will delegate the
+ * is supplied with an {@link Closure remove closure} it will delegate the
* {@link Iterator#remove()} operation to the command.
*
* @param <E> the type of elements returned by the iterable's iterator
@@ -49,8 +49,8 @@ public class LiveCloneIterable<E>
* The specified command will be used by any generated iterators to
* remove objects from the original collection.
*/
- public LiveCloneIterable(Collection<? extends E> collection, ParameterizedCommand<? super E> removeCommand) {
- super(removeCommand);
+ public LiveCloneIterable(Collection<? extends E> collection, Closure<? super E> removeClosure) {
+ super(removeClosure);
if (collection == null) {
throw new NullPointerException();
}
@@ -61,7 +61,7 @@ public class LiveCloneIterable<E>
// ********** Iterable implementation **********
public Iterator<E> iterator() {
- return IteratorTools.clone(this.collection, this.removeCommand);
+ return IteratorTools.clone(this.collection, this.removeClosure);
}
@Override
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/SnapshotCloneIterable.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/SnapshotCloneIterable.java
index 31d0c19299..01dc3f0b09 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/SnapshotCloneIterable.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterable/SnapshotCloneIterable.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.common.utility.internal.iterable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.iterator.CloneIterator;
/**
@@ -29,7 +29,7 @@ import org.eclipse.jpt.common.utility.internal.iterator.CloneIterator;
* By default, the iterator returned by a <code>SnapshotCloneIterable</code> does not
* support the {@link Iterator#remove()} operation; this is because it does not
* have access to the original collection. But if the <code>SnapshotCloneIterable</code>
- * is supplied with an {@link ParameterizedCommand remove command} it will delegate the
+ * is supplied with an {@link Closure remove closure} it will delegate the
* {@link Iterator#remove()} operation to the command.
* <p>
* This iterable is useful for multiple passes over a collection that should not
@@ -52,13 +52,13 @@ public class SnapshotCloneIterable<E>
* The specified command will be used by any generated iterators to
* remove objects from the original collection.
*/
- public SnapshotCloneIterable(Collection<? extends E> collection, ParameterizedCommand<? super E> removeCommand) {
- super(removeCommand);
+ public SnapshotCloneIterable(Collection<? extends E> collection, Closure<? super E> removeClosure) {
+ super(removeClosure);
this.array = collection.toArray();
}
public Iterator<E> iterator() {
- return new LocalCloneIterator<E>(this.array, this.removeCommand);
+ return new LocalCloneIterator<E>(this.array, this.removeClosure);
}
@Override
@@ -73,8 +73,8 @@ public class SnapshotCloneIterable<E>
* provide access to "internal" constructor
*/
protected static class LocalCloneIterator<E> extends CloneIterator<E> {
- protected LocalCloneIterator(Object[] array, ParameterizedCommand<? super E> removeCommand) {
- super(array, removeCommand);
+ protected LocalCloneIterator(Object[] array, Closure<? super E> removeClosure) {
+ super(array, removeClosure);
}
}
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/CloneIterator.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/CloneIterator.java
index e4db53f8c8..c062bda3b5 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/CloneIterator.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/CloneIterator.java
@@ -11,7 +11,7 @@ package org.eclipse.jpt.common.utility.internal.iterator;
import java.util.Collection;
import java.util.Iterator;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
/**
@@ -25,22 +25,22 @@ import org.eclipse.jpt.common.utility.internal.ObjectTools;
* By default, a <code>CloneIterator</code> does not support the
* {@link #remove()} operation; this is because it does not have
* access to the original collection. But if the <code>CloneIterator</code>
- * is supplied with an {@link ParameterizedCommand} it will delegate the
- * {@link #remove()} operation to the {@link ParameterizedCommand}.
+ * is supplied with an {@link Closure} it will delegate the
+ * {@link #remove()} operation to the {@link Closure}.
*
* @param <E> the type of elements returned by the iterator
*
* @see org.eclipse.jpt.common.utility.internal.iterable.IterableTools#cloneLive(Collection)
- * @see org.eclipse.jpt.common.utility.internal.iterable.IterableTools#cloneLive(Collection, ParameterizedCommand)
+ * @see org.eclipse.jpt.common.utility.internal.iterable.IterableTools#cloneLive(Collection, Closure)
* @see org.eclipse.jpt.common.utility.internal.iterable.IterableTools#cloneSnapshot(Collection)
- * @see org.eclipse.jpt.common.utility.internal.iterable.IterableTools#cloneSnapshot(Collection, ParameterizedCommand)
+ * @see org.eclipse.jpt.common.utility.internal.iterable.IterableTools#cloneSnapshot(Collection, Closure)
*/
public class CloneIterator<E>
implements Iterator<E>
{
private final Iterator<Object> iterator;
private E current;
- private final ParameterizedCommand<? super E> removeCommand;
+ private final Closure<? super E> removeClosure;
private boolean removeAllowed;
@@ -49,21 +49,21 @@ public class CloneIterator<E>
* Use the specified command to remove objects from the
* original collection.
*/
- public CloneIterator(Collection<? extends E> collection, ParameterizedCommand<? super E> removeCommand) {
- this(collection.toArray(), removeCommand);
+ public CloneIterator(Collection<? extends E> collection, Closure<? super E> removeClosure) {
+ this(collection.toArray(), removeClosure);
}
/**
* Internal constructor used by subclasses.
*/
- protected CloneIterator(Object[] array, ParameterizedCommand<? super E> removeCommand) {
+ protected CloneIterator(Object[] array, Closure<? super E> removeClosure) {
super();
- if (removeCommand == null) {
+ if (removeClosure == null) {
throw new NullPointerException();
}
this.iterator = IteratorTools.iterator(array);
this.current = null;
- this.removeCommand = removeCommand;
+ this.removeClosure = removeClosure;
this.removeAllowed = false;
}
@@ -89,7 +89,7 @@ public class CloneIterator<E>
if ( ! this.removeAllowed) {
throw new IllegalStateException();
}
- this.removeCommand.execute(this.current);
+ this.removeClosure.execute(this.current);
this.removeAllowed = false;
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/IteratorTools.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/IteratorTools.java
index 94194523f3..0e051f0d6b 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/IteratorTools.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterator/IteratorTools.java
@@ -16,16 +16,16 @@ import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
+import org.eclipse.jpt.common.utility.closure.Closure;
+import org.eclipse.jpt.common.utility.closure.InterruptibleClosure;
import org.eclipse.jpt.common.utility.collection.Queue;
import org.eclipse.jpt.common.utility.collection.Stack;
-import org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.closure.DisabledClosure;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
import org.eclipse.jpt.common.utility.internal.collection.HashBag;
import org.eclipse.jpt.common.utility.internal.collection.ListTools;
-import org.eclipse.jpt.common.utility.internal.command.DisabledParameterizedCommand;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterator.CloneListIterator.Adapter;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateTools;
@@ -201,24 +201,24 @@ public final class IteratorTools {
}
/**
- * Execute the specified command for each element in the specified iterator.
+ * Execute the specified closure for each element in the specified iterator.
*/
- public static <E> void execute(Iterator<? extends E> iterator, ParameterizedCommand<E> command) {
+ public static <E> void execute(Iterator<? extends E> iterator, Closure<E> closure) {
while (iterator.hasNext()) {
- command.execute(iterator.next());
+ closure.execute(iterator.next());
}
}
/**
- * Execute the specified command for each element in the specified iterator.
- * If the command throws an exception for an element, the exception will be
+ * Execute the specified closure for each element in the specified iterator.
+ * If the closure throws an exception for an element, the exception will be
* handled by the specified exception handler and processing of the
* remaining elements will continue.
*/
- public static <E> void execute(Iterator<? extends E> iterator, ParameterizedCommand<E> command, ExceptionHandler exceptionHandler) {
+ public static <E> void execute(Iterator<? extends E> iterator, Closure<E> closure, ExceptionHandler exceptionHandler) {
while (iterator.hasNext()) {
try {
- command.execute(iterator.next());
+ closure.execute(iterator.next());
} catch (Throwable ex) {
exceptionHandler.handleException(ex);
}
@@ -226,25 +226,25 @@ public final class IteratorTools {
}
/**
- * Execute the specified command for each element in the specified iterator.
+ * Execute the specified closure for each element in the specified iterator.
*/
- public static <E> void execute(Iterator<? extends E> iterator, InterruptibleParameterizedCommand<E> command) throws InterruptedException {
+ public static <E> void execute(Iterator<? extends E> iterator, InterruptibleClosure<E> closure) throws InterruptedException {
while (iterator.hasNext()) {
- command.execute(iterator.next());
+ closure.execute(iterator.next());
}
}
/**
- * Execute the specified command for each element in the specified iterator.
- * If the command throws an exception (other than an
+ * Execute the specified closure for each element in the specified iterator.
+ * If the closure throws an exception (other than an
* {@link InterruptedException}) for an element, the exception will be
* handled by the specified exception handler and processing of the
* remaining elements will continue.
*/
- public static <E> void execute(Iterator<? extends E> iterator, InterruptibleParameterizedCommand<E> command, ExceptionHandler exceptionHandler) throws InterruptedException {
+ public static <E> void execute(Iterator<? extends E> iterator, InterruptibleClosure<E> closure, ExceptionHandler exceptionHandler) throws InterruptedException {
while (iterator.hasNext()) {
try {
- command.execute(iterator.next());
+ closure.execute(iterator.next());
} catch (InterruptedException ex) {
throw ex;
} catch (Throwable ex) {
@@ -627,16 +627,16 @@ public final class IteratorTools {
* @see CloneIterator
*/
public static <E> CloneIterator<E> clone(Collection<? extends E> collection) {
- return clone(collection, DisabledParameterizedCommand.instance());
+ return clone(collection, DisabledClosure.instance());
}
/**
* Return an iterator that clones the specified collection before returning
- * elements and uses the specified {@link ParameterizedCommand remove command}.
+ * elements and uses the specified {@link Closure remove closure}.
* @see CloneIterator
*/
- public static <E> CloneIterator<E> clone(Collection<? extends E> collection, ParameterizedCommand<? super E> removeCommand) {
- return new CloneIterator<E>(collection, removeCommand);
+ public static <E> CloneIterator<E> clone(Collection<? extends E> collection, Closure<? super E> removeClosure) {
+ return new CloneIterator<E>(collection, removeClosure);
}
/**
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/jdbc/ResultSetCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/jdbc/ResultSetCommand.java
index e360386cad..0be5f8ded1 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/jdbc/ResultSetCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/jdbc/ResultSetCommand.java
@@ -13,7 +13,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
/**
- * Much like a standard {@link org.eclipse.jpt.common.utility.command.ParameterizedCommand command}
+ * Much like a standard {@link org.eclipse.jpt.common.utility.closure.Closure closure}
* but with a pre-defined argument and allows SQL exceptions.
*/
public interface ResultSetCommand {
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerWrapper.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerWrapper.java
index b73a457434..9fc733073f 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerWrapper.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/TransformerWrapper.java
@@ -19,6 +19,7 @@ import org.eclipse.jpt.common.utility.transformer.Transformer;
*
* @param <I> input: the type of the object passed to the transformer
* @param <O> output: the type of the object returned by the transformer
+ *
* @see #setTransformer(Transformer)
*/
public class TransformerWrapper<I, O>
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java
index 765962477f..8ba67df0f5 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java
@@ -25,7 +25,7 @@ package org.eclipse.jpt.common.utility.transformer;
* @param <O> output: the type of the object returned by the transformer
*
* @see Transformer
- * @see org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand
+ * @see org.eclipse.jpt.common.utility.closure.InterruptibleClosure
* @see org.eclipse.jpt.common.utility.command.InterruptibleCommand
* @see org.eclipse.jpt.common.utility.factory.InterruptibleFactory
*/
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
index a99c39f432..880fb6c939 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
@@ -22,6 +22,10 @@ package org.eclipse.jpt.common.utility.transformer;
*
* @param <I> input: the type of the object passed to the transformer
* @param <O> output: the type of the object returned by the transformer
+ *
+ * @see org.eclipse.jpt.common.utility.closure.Closure
+ * @see org.eclipse.jpt.common.utility.command.Command
+ * @see org.eclipse.jpt.common.utility.factory.Factory
*/
public interface Transformer<I, O>
extends InterruptibleTransformer<I, O>
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java
index 91c014ca2d..e142de2ef8 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java
@@ -22,8 +22,8 @@ import org.eclipse.jpt.common.utility.internal.ArrayTools;
import org.eclipse.jpt.common.utility.internal.ClassTools;
import org.eclipse.jpt.common.utility.internal.Range;
import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.command.InterruptibleParameterizedCommandAdapter;
-import org.eclipse.jpt.common.utility.internal.command.ParameterizedCommandAdapter;
+import org.eclipse.jpt.common.utility.internal.closure.ClosureAdapter;
+import org.eclipse.jpt.common.utility.internal.closure.InterruptibleClosureAdapter;
import org.eclipse.jpt.common.utility.internal.comparator.ReverseComparator;
import org.eclipse.jpt.common.utility.internal.iterator.EmptyIterator;
import org.eclipse.jpt.common.utility.internal.predicate.PredicateAdapter;
@@ -3165,13 +3165,13 @@ public class ArrayToolsTests
public void testExecuteObjectArrayParmCommand() {
String[] a = this.buildStringArray1();
- ConcatenateCommand command = new ConcatenateCommand();
+ ConcatenateClosure command = new ConcatenateClosure();
ArrayTools.execute(a, command);
assertEquals("zeroonetwo", command.string);
}
- public static class ConcatenateCommand
- extends ParameterizedCommandAdapter<String>
+ public static class ConcatenateClosure
+ extends ClosureAdapter<String>
{
public String string = StringTools.EMPTY_STRING;
@@ -3183,13 +3183,13 @@ public class ArrayToolsTests
public void testExecuteObjectArrayInterruptibleParmCommand() throws Exception {
String[] a = this.buildStringArray1();
- InterruptibleConcatenateCommand command = new InterruptibleConcatenateCommand();
+ InterruptibleConcatenateClosure command = new InterruptibleConcatenateClosure();
ArrayTools.execute(a, command);
assertEquals("zeroonetwo", command.string);
}
- public static class InterruptibleConcatenateCommand
- extends InterruptibleParameterizedCommandAdapter<String>
+ public static class InterruptibleConcatenateClosure
+ extends InterruptibleClosureAdapter<String>
{
public String string = StringTools.EMPTY_STRING;
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/CloneIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/CloneIterableTests.java
index cce63109fe..3bb881ed1e 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/CloneIterableTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/CloneIterableTests.java
@@ -14,7 +14,7 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterator.CloneListIterator;
@@ -90,8 +90,8 @@ public abstract class CloneIterableTests
abstract Iterable<String> buildIterableWithRemover(List<String> c);
- ParameterizedCommand<String> buildRemoveCommand(final Collection<String> c) {
- return new ParameterizedCommand<String>() {
+ Closure<String> buildRemoveCommand(final Collection<String> c) {
+ return new Closure<String>() {
public void execute(String current) {
c.remove(current);
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/IterableToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/IterableToolsTests.java
index faede08dad..65fbaaf42b 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/IterableToolsTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterable/IterableToolsTests.java
@@ -152,16 +152,16 @@ public class IterableToolsTests
public void testExecuteParmCommand() {
List<String> list = this.buildStringList1();
- ArrayToolsTests.ConcatenateCommand command = new ArrayToolsTests.ConcatenateCommand();
- IterableTools.execute(list, command);
- assertEquals("zeroonetwo", command.string);
+ ArrayToolsTests.ConcatenateClosure closure = new ArrayToolsTests.ConcatenateClosure();
+ IterableTools.execute(list, closure);
+ assertEquals("zeroonetwo", closure.string);
}
public void testExecuteInterruptibleParmCommand() throws Exception {
List<String> list = this.buildStringList1();
- ArrayToolsTests.InterruptibleConcatenateCommand command = new ArrayToolsTests.InterruptibleConcatenateCommand();
- IterableTools.execute(list, command);
- assertEquals("zeroonetwo", command.string);
+ ArrayToolsTests.InterruptibleConcatenateClosure closure = new ArrayToolsTests.InterruptibleConcatenateClosure();
+ IterableTools.execute(list, closure);
+ assertEquals("zeroonetwo", closure.string);
}
public void testGetIterableInt() {
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/CloneIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/CloneIteratorTests.java
index ce490ab51a..3ed3446df8 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/CloneIteratorTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/CloneIteratorTests.java
@@ -14,7 +14,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.NoSuchElementException;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
import org.eclipse.jpt.common.utility.tests.internal.MultiThreadedTestCase;
import org.eclipse.jpt.common.utility.tests.internal.TestTools;
@@ -87,7 +87,7 @@ public class CloneIteratorTests
}
public void testRemoveRemover() {
- ParameterizedCommand<String> remover = new ParameterizedCommand<String>() {
+ Closure<String> remover = new Closure<String>() {
public void execute(String element) {
CloneIteratorTests.this.originalCollection.remove(element);
}
@@ -96,7 +96,7 @@ public class CloneIteratorTests
}
public void testRemoveRemover_super() {
- ParameterizedCommand<Object> remover = new ParameterizedCommand<Object>() {
+ Closure<Object> remover = new Closure<Object>() {
public void execute(Object element) {
CloneIteratorTests.this.originalCollection.remove(element);
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/IteratorToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/IteratorToolsTests.java
index 56e9050abe..435bc231ec 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/IteratorToolsTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterator/IteratorToolsTests.java
@@ -265,16 +265,16 @@ public class IteratorToolsTests
public void testExecuteParmCommand() {
List<String> list = this.buildStringList1();
- ArrayToolsTests.ConcatenateCommand command = new ArrayToolsTests.ConcatenateCommand();
- IteratorTools.execute(list.iterator(), command);
- assertEquals("zeroonetwo", command.string);
+ ArrayToolsTests.ConcatenateClosure closure = new ArrayToolsTests.ConcatenateClosure();
+ IteratorTools.execute(list.iterator(), closure);
+ assertEquals("zeroonetwo", closure.string);
}
public void testExecuteInterruptibleParmCommand() throws Exception {
List<String> list = this.buildStringList1();
- ArrayToolsTests.InterruptibleConcatenateCommand command = new ArrayToolsTests.InterruptibleConcatenateCommand();
- IteratorTools.execute(list.iterator(), command);
- assertEquals("zeroonetwo", command.string);
+ ArrayToolsTests.InterruptibleConcatenateClosure closure = new ArrayToolsTests.InterruptibleConcatenateClosure();
+ IteratorTools.execute(list.iterator(), closure);
+ assertEquals("zeroonetwo", closure.string);
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
index 4dfe44ad15..f4c64afb62 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
@@ -15,7 +15,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
import org.eclipse.jpt.common.utility.internal.exception.RuntimeExceptionHandler;
@@ -244,7 +244,7 @@ public class ReflectiveCollectionChangeListenerTests extends TestCase {
return new ChangeSupport(this, RuntimeExceptionHandler.instance());
}
Iterator<String> strings() {
- return IteratorTools.clone(this.strings, new ParameterizedCommand<String>() {
+ return IteratorTools.clone(this.strings, new Closure<String>() {
public void execute(String s) {
TestModel.this.removeString(s);
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
index 1d5012ce6d..82677aac1c 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
@@ -19,7 +19,7 @@ import java.util.List;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
@@ -420,7 +420,7 @@ public class TableModelAdapterTests
public Iterator<Person> people() {
- return IteratorTools.clone(this.people, new ParameterizedCommand<Person>() {
+ return IteratorTools.clone(this.people, new Closure<Person>() {
public void execute(Person person) {
Crowd.this.removePerson(person);
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java
index 540795d00c..9a42251662 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java
@@ -13,7 +13,7 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.command.ParameterizedCommand;
+import org.eclipse.jpt.common.utility.closure.Closure;
import org.eclipse.jpt.common.utility.internal.collection.HashBag;
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
import org.eclipse.jpt.common.utility.internal.node.AbstractNode;
@@ -405,7 +405,7 @@ public class AbstractNodeTests
}
public Iterator<TestWorkbenchModel> testChildren() {
- return IteratorTools.clone(this.testChildren, new ParameterizedCommand<TestWorkbenchModel>() {
+ return IteratorTools.clone(this.testChildren, new Closure<TestWorkbenchModel>() {
public void execute(TestWorkbenchModel current) {
TestWorkbenchModel.this.removeTestChild(current);
}

Back to the top