From 44be6e6cd7671dd243056107ffa6201504f7fbce Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Sun, 25 Jun 2023 15:50:38 -0400 Subject: Update a number of things --- src/main/java/bjc/esodata/Spool.java | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/bjc/esodata/Spool.java (limited to 'src/main/java/bjc/esodata/Spool.java') 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 The type contained by the spool + */ +public interface Spool { + /** + * 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 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 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 -- cgit v1.2.3