From 504ca816530efdff06bc202e0432ebd354aec304 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:07:14 -0400 Subject: Cleanup --- .../src/main/java/bjc/utils/gen/RandomGrammar.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java b/BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java index 5d054cf..4153e7d 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java +++ b/BJC-Utils2/src/main/java/bjc/utils/gen/RandomGrammar.java @@ -5,7 +5,7 @@ import bjc.utils.funcdata.IList; /** * A weighted grammar where all the rules have a equal chance of occuring. - * + * * @author ben * * @param @@ -21,7 +21,7 @@ public class RandomGrammar extends WeightedGrammar { /** * Add cases to a specified rule. - * + * * @param rule * The name of the rule to add cases to. * @param cases @@ -29,14 +29,14 @@ public class RandomGrammar extends WeightedGrammar { */ @SafeVarargs public final void addCases(E rule, IList... cases) { - for (IList currentCase : cases) { + for(IList currentCase : cases) { super.addCase(rule, 1, currentCase); } } /** * Create a rule with the specified name and cases. - * + * * @param rule * The name of the rule to add. * @param cases @@ -46,23 +46,21 @@ public class RandomGrammar extends WeightedGrammar { public final void makeRule(E rule, IList... cases) { super.addRule(rule); - for (IList currentCase : cases) { + for(IList currentCase : cases) { super.addCase(rule, 1, currentCase); } } /** * Create a rule with the specified name and cases. - * + * * @param rule * The name of the rule to add. * @param cases * The cases to add for this rule. */ public void makeRule(E rule, IList> cases) { - if (cases == null) { - throw new NullPointerException("Cases must not be null"); - } + if(cases == null) throw new NullPointerException("Cases must not be null"); super.addRule(rule); -- cgit v1.2.3