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/Rule.java | |
| parent | 9a0bf41772184f7072f76cfa94e520d022261e4f (diff) | |
Source cleanup
Diffstat (limited to 'RGens/src/main/java/bjc/rgens/newparser/Rule.java')
| -rw-r--r-- | RGens/src/main/java/bjc/rgens/newparser/Rule.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/RGens/src/main/java/bjc/rgens/newparser/Rule.java b/RGens/src/main/java/bjc/rgens/newparser/Rule.java index aee1a89..612d603 100644 --- a/RGens/src/main/java/bjc/rgens/newparser/Rule.java +++ b/RGens/src/main/java/bjc/rgens/newparser/Rule.java @@ -9,24 +9,22 @@ import java.util.Random; * A rule in a randomized grammar. * * @author EVE - * */ public class Rule { - /** - * The name of this grammar rule. - */ + /** The name of this grammar rule. */ public final String name; + /* The cases for this rule. */ private IList<RuleCase> cases; /** * Create a new grammar rule. * * @param ruleName - * The name of the grammar rule. + * The name of the grammar rule. * * @throws IllegalArgumentException - * If the rule name is invalid. + * If the rule name is invalid. */ public Rule(String ruleName) { if (ruleName == null) { @@ -44,7 +42,7 @@ public class Rule { * Adds a case to the rule. * * @param cse - * The case to add. + * The case to add. */ public void addCase(RuleCase cse) { if (cse == null) { @@ -57,7 +55,8 @@ public class Rule { /** * Get a random case from this rule. * - * @return A random case from this rule. + * @return + * A random case from this rule. */ public RuleCase getCase() { return cases.randItem(); @@ -67,9 +66,10 @@ public class Rule { * Get a random case from this rule. * * @param rnd - * The random number generator to use. + * The random number generator to use. * - * @return A random case from this rule. + * @return + * A random case from this rule. */ public RuleCase getCase(Random rnd) { return cases.randItem(rnd::nextInt); @@ -78,7 +78,8 @@ public class Rule { /** * Get all the cases of this rule. * - * @return All the cases in this rule. + * @return + * All the cases in this rule. */ public IList<RuleCase> getCases() { return cases; @@ -120,4 +121,4 @@ public class Rule { public String toString() { return String.format("Rule [ruleName='%s', ruleCases=%s]", name, cases); } -}
\ No newline at end of file +} |
