summaryrefslogtreecommitdiff
path: root/dice-lang/src/bjc/dicelang/v1/ast/IntegerResult.java
blob: 61d57b7ca53c13a3ede7c3f6e7b90f67e76b7d95 (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.v1.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);
	}
}