From 01cb9f504c860bc1c037a44f3a76bf342a293d46 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 22 Mar 2016 12:28:35 -0400 Subject: General formatting cleanup and documentation update --- .../java/bjc/utils/dice/BindingDiceExpression.java | 41 ++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java b/BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java index a715074..9ecce97 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java +++ b/BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java @@ -10,9 +10,33 @@ import java.util.Map; * */ public class BindingDiceExpression implements IDiceExpression { - private String name; + /** + * The expression being bound to a name + */ private IDiceExpression exp; + /** + * The name to bind the expression to + */ + private String name; + + /** + * Create a new dice expression binder from two expressions and an + * enviroment + * + * @param left + * The left side expression to get a name from. Must be a + * ReferenceDiceExpression + * @param right + * The right side to bind to the name + * @param env + * The enviroment to bind into + */ + public BindingDiceExpression(IDiceExpression left, + IDiceExpression right, Map env) { + this(((ReferenceDiceExpression) left).getName(), right, env); + } + /** * Create a new dice expression binder * @@ -31,16 +55,21 @@ public class BindingDiceExpression implements IDiceExpression { env.put(name, exp); } - public BindingDiceExpression(IDiceExpression left, - IDiceExpression right, Map env) { - this(((ReferenceDiceExpression) left).getName(), right, env); - } - + /* + * (non-Javadoc) + * + * @see bjc.utils.dice.IDiceExpression#roll() + */ @Override public int roll() { return exp.roll(); } + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ @Override public String toString() { return "assign[n=" + name + ", exp=" + exp.toString() + "]"; -- cgit v1.2.3