public TokenTuple( HeapRegionNode hrn ) {
+ assert hrn != null;
+
token = hrn.getID();
isNewSummary = hrn.isNewSummary();
arity = ARITY_ONE;
public TokenTuple( Integer token,
boolean isNewSummary,
int arity ) {
+ assert token != null;
+
this.token = token;
this.isNewSummary = isNewSummary;
this.arity = arity;
public TokenTuple changeTokenTo( Integer tokenToChangeTo ) {
- assert isNewSummary == false;
+ assert tokenToChangeTo != null;
+ assert isNewSummary == false;
return new TokenTuple( tokenToChangeTo,
isNewSummary,
}
public int hashCode() {
- return (Math.abs( token.intValue() + 20000 ) + arity*100000) % 12789;
+ return token.intValue()*31 + arity;
}