diff options
| author | student <student@localhost> | 2018-04-04 16:26:53 -0400 |
|---|---|---|
| committer | student <student@localhost> | 2018-04-04 16:26:53 -0400 |
| commit | 43524b0742f195304829e5bd4dd12492f8ad1aa1 (patch) | |
| tree | 8b0a82ce08c8636be9bad88786bc087347ddc1a6 /base/src/bjc/dicelang/eval/EvaluatorResult.java | |
| parent | 9f492d118835acab63dab02bd601475e4127dd28 (diff) | |
More Evaluator work
Diffstat (limited to 'base/src/bjc/dicelang/eval/EvaluatorResult.java')
| -rw-r--r-- | base/src/bjc/dicelang/eval/EvaluatorResult.java | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/base/src/bjc/dicelang/eval/EvaluatorResult.java b/base/src/bjc/dicelang/eval/EvaluatorResult.java index 1a783ad..ff86447 100644 --- a/base/src/bjc/dicelang/eval/EvaluatorResult.java +++ b/base/src/bjc/dicelang/eval/EvaluatorResult.java @@ -46,37 +46,40 @@ public class EvaluatorResult { */ public final EvaluatorResult.Type type; - // These may or may not have values based - // off of the result type - /** - * The integer value of the result. - */ - public long intVal; - /** * Create a new result. * * @param typ - * The type of the result. + * The type of the result. */ protected EvaluatorResult(final EvaluatorResult.Type typ) { type = typ; } - /** - * Create a new result. - * - * @param typ - * @param iVal - */ - public EvaluatorResult(final EvaluatorResult.Type typ, final long iVal) { - this(typ); + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((type == null) ? 0 : type.hashCode()); + return result; + } - intVal = iVal; + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + EvaluatorResult other = (EvaluatorResult) obj; + if (type != other.type) + return false; + return true; } @Override public String toString() { - return type.toString(); + return "EvaluatorResult [type=" + type + "]"; } } |
