diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-11-06 20:56:21 -0400 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-11-06 20:56:21 -0400 |
| commit | cba5ae6bc285439593f4e847c0d3b32e8e608ec8 (patch) | |
| tree | 7a5b6f6ca85aa9984730787d4e20fe38aec0a197 /RGens/src/main/java/bjc/rgens/newparser/RuleCase.java | |
| parent | 8d7b542ba7182b701a75a0fd5550e68f421ea696 (diff) | |
Minor source tweaks
More attempted spacing tweaks and stuff
Diffstat (limited to 'RGens/src/main/java/bjc/rgens/newparser/RuleCase.java')
| -rw-r--r-- | RGens/src/main/java/bjc/rgens/newparser/RuleCase.java | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java b/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java index 9b2cfc5..217d668 100644 --- a/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java +++ b/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java @@ -39,28 +39,9 @@ public class RuleCase { * <dd>Used as the list of elementList the rule is composed of.</dd> * </dl> */ - private IList<CaseElement> elementList; - - /** - * Create a new case of the specified type. - * - * @param typ - * The type of case to create. - * - * @throws IllegalArgumentException - * If the type requires parameters. - */ - public RuleCase(CaseType typ) { - switch (typ) { - case NORMAL: - case SPACEFLATTEN: - throw new IllegalArgumentException("This type requires an element list parameter"); - case REGEX: - throw new IllegalArgumentException("This type requires an element list and a pattern"); - default: - break; - } + protected IList<CaseElement> elementList; + protected RuleCase(CaseType typ) { type = typ; } @@ -78,6 +59,8 @@ public class RuleCase { * If this type doesn't take a element list parameter. */ public RuleCase(CaseType typ, IList<CaseElement> elements) { + this(typ); + switch (typ) { case NORMAL: case SPACEFLATTEN: @@ -88,8 +71,6 @@ public class RuleCase { throw new IllegalArgumentException("This type doesn't have a element list parameter"); } - type = typ; - elementList = elements; } |
