From e9e0ca7bfe722375e7ccb25d2bafbe395b6c6a59 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Tue, 6 Oct 2020 19:16:26 -0400 Subject: Info cleanup --- src/main/java/bjc/rgens/parser/RuleCase.java | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/main/java/bjc/rgens/parser/RuleCase.java') diff --git a/src/main/java/bjc/rgens/parser/RuleCase.java b/src/main/java/bjc/rgens/parser/RuleCase.java index dacb16e..3cfe81d 100755 --- a/src/main/java/bjc/rgens/parser/RuleCase.java +++ b/src/main/java/bjc/rgens/parser/RuleCase.java @@ -15,14 +15,25 @@ import java.util.List; * @author EVE */ public abstract class RuleCase { + /** + * Debugging name for this case. + */ public String debugName; + /** + * Serial number for this case. + */ public final int serial; - private static int nextSerial = 0; + /** + * The rule this case belongs to. + */ public Rule belongsTo; + /** + * The elements that make up this case. + */ public List elementList; /** @@ -40,10 +51,23 @@ public abstract class RuleCase { nextSerial += 1; } + /** + * Generate this case. + * + * @param state The state to use. + */ public abstract void generate(GenerationState state); + /** + * Create a new case with a different set of elements. + * + * @param elements The elements for this case. + * + * @return The case with the same settings, but a different set of elements. + */ public abstract RuleCase withElements(List elements); + @Override public String toString() { if(debugName != null) { return String.format("Case %s (#%d) of %s", debugName, serial, belongsTo); -- cgit v1.2.3