summaryrefslogtreecommitdiff
path: root/dice-lang/src/main/java/bjc/dicelang/ast/IntegerResult.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2016-04-18 17:22:36 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2016-04-18 17:22:36 -0400
commitbf5f97983a7cd58e5d1147d6d6d93c2b307fe0fb (patch)
tree3d1e41c8a7b9cfa5f32c5708a3a223f4e7ee5e8f /dice-lang/src/main/java/bjc/dicelang/ast/IntegerResult.java
parent24f3ce54983348e1aa0229d5c08b3fe99d739d40 (diff)
Implemented arrays
Diffstat (limited to 'dice-lang/src/main/java/bjc/dicelang/ast/IntegerResult.java')
-rw-r--r--dice-lang/src/main/java/bjc/dicelang/ast/IntegerResult.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/dice-lang/src/main/java/bjc/dicelang/ast/IntegerResult.java b/dice-lang/src/main/java/bjc/dicelang/ast/IntegerResult.java
new file mode 100644
index 0000000..c8d9a64
--- /dev/null
+++ b/dice-lang/src/main/java/bjc/dicelang/ast/IntegerResult.java
@@ -0,0 +1,40 @@
+package bjc.dicelang.ast;
+
+/**
+ * Represents a integer-valued result
+ *
+ * @author ben
+ *
+ */
+public class IntegerResult implements IResult {
+ private int value;
+
+ /**
+ * Create a new integer valued result
+ *
+ * @param val
+ * The value of the result
+ */
+ public IntegerResult(int val) {
+ value = val;
+ }
+
+ /**
+ * Get the value of this result
+ *
+ * @return The value of this result
+ */
+ public int getValue() {
+ return value;
+ }
+
+ @Override
+ public ResultType getType() {
+ return ResultType.INTEGER;
+ }
+
+ @Override
+ public String toString() {
+ return Integer.toString(value);
+ }
+}