summaryrefslogtreecommitdiff
path: root/dice/src/example/java/bjc/dicelang/neodice/statements/DiePoolStatementValue.java
blob: a4a9104fc4b95969e8a534dc77d0ab0409528f92 (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
package bjc.dicelang.neodice.statements;

import static bjc.dicelang.neodice.statements.StatementValue.Type.*;

import java.util.*;

import bjc.dicelang.neodice.*;

public class DiePoolStatementValue extends StatementValue {
	public final DiePool value;
	
	public DiePoolStatementValue(DiePool value) {
		super(DIEPOOL);
		
		this.value = value;
	}
	
	@Override
	public String toString() {
		return "(" + value.toString() + ")";
	}

	@Override
	public int hashCode() {
		return Objects.hash(value);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)                  return true;
		if (obj == null)                  return false;
		if (getClass() != obj.getClass()) return false;

		DiePoolStatementValue other = (DiePoolStatementValue) obj;
		
		return Objects.equals(value, other.value);
	}
}