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); }