From 924bcdc9a65c7f88004d6dbf8dfa138c9a125e5d Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Wed, 11 Oct 2017 22:25:09 -0300 Subject: Source cleanup --- .../main/java/bjc/rgens/newparser/RuleCase.java | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'RGens/src/main/java/bjc/rgens/newparser/RuleCase.java') diff --git a/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java b/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java index c22aa98..4ec0d2d 100644 --- a/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java +++ b/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java @@ -2,6 +2,11 @@ package bjc.rgens.newparser; import bjc.utils.funcdata.IList; +/* + * @NOTE + * If at some point we add new case types, they should go into subclasses, + * not into this class. + */ /** * A case in a rule in a randomized grammar. * @@ -12,18 +17,13 @@ public class RuleCase { * The possible types of a case. * * @author EVE - * */ public static enum CaseType { - /** - * A normal case, composed from a list of elementList. - */ + /** A normal case, composed from a list of elementList. */ NORMAL, } - /** - * The type of this case. - */ + /** The type of this case. */ public final CaseType type; /** @@ -41,16 +41,15 @@ public class RuleCase { * Create a new case of the specified type. * * @param typ - * The type of case to create. + * The type of case to create. * * @throws IllegalArgumentException - * If the type requires parameters. + * If the type requires parameters. */ public RuleCase(CaseType typ) { switch (typ) { case NORMAL: throw new IllegalArgumentException("This type requires an element list parameter"); - default: break; } @@ -63,19 +62,18 @@ public class RuleCase { * parameter. * * @param typ - * The type of case to create. + * The type of case to create. * * @param elements - * The element list parameter of the case. + * The element list parameter of the case. * * @throws IllegalArgumentException - * If this type doesn't take a element list parameter. + * If this type doesn't take a element list parameter. */ public RuleCase(CaseType typ, IList elements) { switch (typ) { case NORMAL: break; - default: throw new IllegalArgumentException("This type doesn't have a element list parameter"); } @@ -88,8 +86,9 @@ public class RuleCase { /** * Get the element list value of this type. * - * @return The element list value of this case, or null if this type - * doesn't have one. + * @return + * The element list value of this case, or null if this type + * doesn't have one. */ public IList getElements() { return elementList; -- cgit v1.2.3