summaryrefslogtreecommitdiff
path: root/same/src
diff options
context:
space:
mode:
Diffstat (limited to 'same/src')
-rw-r--r--same/src/main/java/com/orbekk/util/WorkList.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/same/src/main/java/com/orbekk/util/WorkList.java b/same/src/main/java/com/orbekk/util/WorkList.java
new file mode 100644
index 0000000..a4e38d6
--- /dev/null
+++ b/same/src/main/java/com/orbekk/util/WorkList.java
@@ -0,0 +1,21 @@
+package com.orbekk.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class WorkList<E> extends ArrayList<E> {
+ public WorkList() {
+ super();
+ }
+
+ public WorkList(Collection<? extends E> collection) {
+ super(collection);
+ }
+
+ public synchronized List<E> copyAndClear() {
+ List<E> copy = new WorkList<E>(this);
+ clear();
+ return copy;
+ }
+}