From d02e409ef8a389101970e70a105d30b7b1948ecf Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Wed, 16 Nov 2016 10:53:39 -0500 Subject: Update --- .../src/main/java/bjc/utils/data/SingleSupplier.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'BJC-Utils2/src/main/java/bjc/utils/data') diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java b/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java index f40ab29..ad00496 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java @@ -2,6 +2,16 @@ package bjc.utils.data; import java.util.function.Supplier; +/** + * A supplier that can only supply one value. + * + * Attempting to retrieve another value will cause an exception to be + * thrown. + * + * @author ben + * + * @param + */ public class SingleSupplier implements Supplier { private static long nextID = 0; @@ -15,6 +25,12 @@ public class SingleSupplier implements Supplier { // instantiation was, in case of duplicate initiations private Exception instSite; + /** + * Create a new single supplier from an existing value + * + * @param supp + * The supplier to give a single value from + */ public SingleSupplier(Supplier supp) { source = supp; -- cgit v1.2.3