summaryrefslogtreecommitdiff
path: root/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'RGens/src/main/java/bjc/rgens/newparser/RuleCase.java')
-rw-r--r--RGens/src/main/java/bjc/rgens/newparser/RuleCase.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java b/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java
index 9652273..3f971c3 100644
--- a/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java
+++ b/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java
@@ -4,13 +4,13 @@ import bjc.utils.funcdata.IList;
/**
* A case in a rule in a randomized grammar.
- *
+ *
* @author EVE
*/
public class RuleCase {
/**
* The possible types of a case.
- *
+ *
* @author EVE
*
*/
@@ -28,7 +28,7 @@ public class RuleCase {
/**
* The list of element values for this case.
- *
+ *
* <h2>Used For</h2>
* <dl>
* <dt>NORMAL</dt>
@@ -39,17 +39,18 @@ public class RuleCase {
/**
* 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) {
+ switch (typ) {
case NORMAL:
throw new IllegalArgumentException("This type requires an element list parameter");
+
default:
break;
}
@@ -60,20 +61,21 @@ public class RuleCase {
/**
* Create a new case of the specified type that takes a element list
* parameter.
- *
+ *
* @param typ
* The type of case to create.
- *
+ *
* @param elements
* The element list parameter of the case.
- *
+ *
* @throws IllegalArgumentException
* If this type doesn't take a element list parameter.
*/
public RuleCase(CaseType typ, IList<CaseElement> elements) {
- switch(typ) {
+ switch (typ) {
case NORMAL:
break;
+
default:
throw new IllegalArgumentException("This type doesn't have a element list parameter");
}
@@ -85,7 +87,7 @@ 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.
*/