From 843329de434bb334d90927c4d22345373a388530 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 2 Jul 2019 18:05:22 -0400 Subject: Rename package root The package root is now bjc, not io.github.bculkin2442. --- src/main/java/bjc/data/Toggle.java | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/java/bjc/data/Toggle.java (limited to 'src/main/java/bjc/data/Toggle.java') diff --git a/src/main/java/bjc/data/Toggle.java b/src/main/java/bjc/data/Toggle.java new file mode 100644 index 0000000..14c77d3 --- /dev/null +++ b/src/main/java/bjc/data/Toggle.java @@ -0,0 +1,34 @@ +package bjc.data; + +/** + * A stateful holder that swaps between two values of the same type. + * + * @author EVE + * + * @param + * The value stored in the toggle. + */ +public interface Toggle { + /** + * Retrieve the currently-aligned value of this toggle, and swap the + * value to the new one. + * + * @return The previously-aligned value. + */ + E get(); + + /** + * Retrieve the currently-aligned value without altering the alignment. + * + * @return The currently-aligned value. + */ + E peek(); + + /** + * Change the alignment of the toggle. + * + * @param isLeft + * Whether the toggle should be left-aligned or not. + */ + void set(boolean isLeft); +} -- cgit v1.2.3