diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-11 22:25:09 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-11 22:25:09 -0300 |
| commit | 924bcdc9a65c7f88004d6dbf8dfa138c9a125e5d (patch) | |
| tree | 396bcf7bb59e17091f268dadebbcdb42725e49c7 /RGens/src/main/java/bjc/rgens/newparser/RuleCase.java | |
| parent | 9a0bf41772184f7072f76cfa94e520d022261e4f (diff) | |
Source cleanup
Diffstat (limited to 'RGens/src/main/java/bjc/rgens/newparser/RuleCase.java')
| -rw-r--r-- | RGens/src/main/java/bjc/rgens/newparser/RuleCase.java | 31 |
1 files changed, 15 insertions, 16 deletions
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<CaseElement> 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<CaseElement> getElements() { return elementList; |
