summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/esodata/Spool.java
diff options
context:
space:
mode:
authorBen Culkin <scorpress@gmail.com>2023-06-25 15:50:38 -0400
committerBen Culkin <scorpress@gmail.com>2023-06-25 15:50:38 -0400
commit44be6e6cd7671dd243056107ffa6201504f7fbce (patch)
treeea6d1d0bf5930395c3b79b40b4889782dc1b5791 /src/main/java/bjc/esodata/Spool.java
parent0f958b08b3446a866418aa485bb60c208d952033 (diff)
Update a number of things
Diffstat (limited to 'src/main/java/bjc/esodata/Spool.java')
-rw-r--r--src/main/java/bjc/esodata/Spool.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/main/java/bjc/esodata/Spool.java b/src/main/java/bjc/esodata/Spool.java
new file mode 100644
index 0000000..f065093
--- /dev/null
+++ b/src/main/java/bjc/esodata/Spool.java
@@ -0,0 +1,48 @@
+package bjc.esodata;
+
+import java.util.Iterator;
+import java.util.function.Consumer;
+
+/**
+ * A single spool, or batch of input.
+ *
+ * @author bjcul
+ *
+ * @param <T> The type contained by the spool
+ */
+public interface Spool<T> {
+ /**
+ * Get the label that identifies this spool, if it has one.
+ *
+ * @return The label of the spool, or null if it is unlabeled.
+ */
+ public String label();
+
+ /**
+ * Get the group that this spool belongs to, if it belongs to one.
+ *
+ * @return The group the spool is in, or null if it is not in a group.
+ */
+ public String group();
+
+ /**
+ * Get a function that will add input to this spool
+ *
+ * @return A function that will add input to this spool.
+ */
+ public Consumer<T> getInput();
+
+ /**
+ * Get an iterator that will iterate over the data contained in this spool.
+ *
+ * @return An iterator over the data in this spool.
+ */
+ public Iterator<T> getOutput();
+
+ /**
+ * Is this spool closed, meaning it can accept no more input?
+ *
+ * @return Whether the spool is closed
+ */
+ public boolean isClosed();
+} \ No newline at end of file