summaryrefslogtreecommitdiff
path: root/dice-lang/src/main/java/bjc/dicelang/ast/IntegerResult.java
blob: ce61d389cf0584a85b525b5d72c071698bc382d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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;
	}

	@Override
	public ResultType getType() {
		return ResultType.INTEGER;
	}

	/**
	 * Get the value of this result
	 * 
	 * @return The value of this result
	 */
	public int getValue() {
		return value;
	}

	@Override
	public String toString() {
		return Integer.toString(value);
	}
}