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 --- .../bjc/utils/dice/ReferenceDiceExpression.java | 36 ++++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java b/BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java index d8062da..d38e0f9 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java +++ b/BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java @@ -11,14 +11,14 @@ import java.util.Map; */ public class ReferenceDiceExpression implements IDiceExpression { /** - * The name of the bound variable + * The enviroment to do variable dereferencing against */ - private String name; + private Map env; /** - * The enviroment to do variable dereferencing against + * The name of the bound variable */ - private Map env; + private String name; /** * Create a new reference dice expression referring to the given name @@ -35,11 +35,30 @@ public class ReferenceDiceExpression implements IDiceExpression { this.env = env; } + /** + * Get the name of the referenced variable + * + * @return the name of the referenced variable + */ + public String getName() { + return name; + } + + /* + * (non-Javadoc) + * + * @see bjc.utils.dice.IDiceExpression#roll() + */ @Override public int roll() { return env.get(name).roll(); } + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ @Override public String toString() { if (env.containsKey(name)) { @@ -48,13 +67,4 @@ public class ReferenceDiceExpression implements IDiceExpression { return name; } } - - /** - * Get the name of the referenced variable - * - * @return the name of the referenced variable - */ - public String getName() { - return name; - } } -- cgit v1.2.3