diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-22 14:48:04 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-22 14:48:04 -0400 |
| commit | 42f7d379a430aaf2fad169f0170de04072b08b10 (patch) | |
| tree | 5d46b43b2d9272f4e593820ee147b3ae3f0d82b0 /BJC-Utils2/src/main/java/bjc/utils/gen | |
| parent | b65b705c391bb772bc41269bce5243c1cc88969d (diff) | |
Formatting changes
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/gen')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/gen/WeightedGrammar.java | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/gen/WeightedGrammar.java b/BJC-Utils2/src/main/java/bjc/utils/gen/WeightedGrammar.java index 8d31576..131e507 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/gen/WeightedGrammar.java +++ b/BJC-Utils2/src/main/java/bjc/utils/gen/WeightedGrammar.java @@ -187,6 +187,34 @@ public class WeightedGrammar<E> { } /** + * Remove a rule with the specified name. + * + * @param name + * The name of the rule to remove. + */ + public void deleteRule(E name) { + if (name == null) { + throw new NullPointerException("Rule name must not be null"); + } + + rules.remove(name); + } + + /** + * Remove a subgrammar with the specified name. + * + * @param name + * The name of the subgrammar to remove. + */ + public void deleteSubgrammar(E name) { + if (name == null) { + throw new NullPointerException("Rule name must not be null"); + } + + subgrammars.remove(name); + } + + /** * Generate a set of debug sentences for the specified rule. Only * generates sentances one layer deep. * @@ -295,6 +323,24 @@ public class WeightedGrammar<E> { } /** + * Returns the number of rules in this grammar + * + * @return The number of rules in this grammar + */ + public int getRuleCount() { + return rules.getSize(); + } + + /** + * Returns a set containing all of the rules in this grammar + * + * @return The set of all rule names in this grammar + */ + public IFunctionalList<E> getRuleNames() { + return rules.keyList(); + } + + /** * Get the subgrammar with the specified name. * * @param name @@ -429,52 +475,6 @@ public class WeightedGrammar<E> { } /** - * Remove a rule with the specified name. - * - * @param name - * The name of the rule to remove. - */ - public void deleteRule(E name) { - if (name == null) { - throw new NullPointerException("Rule name must not be null"); - } - - rules.remove(name); - } - - /** - * Remove a subgrammar with the specified name. - * - * @param name - * The name of the subgrammar to remove. - */ - public void deleteSubgrammar(E name) { - if (name == null) { - throw new NullPointerException("Rule name must not be null"); - } - - subgrammars.remove(name); - } - - /** - * Returns the number of rules in this grammar - * - * @return The number of rules in this grammar - */ - public int getRuleCount() { - return rules.getSize(); - } - - /** - * Returns a set containing all of the rules in this grammar - * - * @return The set of all rule names in this grammar - */ - public IFunctionalList<E> getRuleNames() { - return rules.keyList(); - } - - /** * Set the initial rule of the graphic * * @param initRule |
