1 package polyglot.ext.coffer.types; 2 3 import polyglot.ext.jl.types.*; 4 import polyglot.types.*; 5 import polyglot.util.*; 6 import java.util.*; 7 8 public class ThrowConstraint_c extends TypeObject_c implements ThrowConstraint { 9 Type throwType; 10 KeySet keys; 11 12 public ThrowConstraint_c(CofferTypeSystem ts, Position pos, 13 Type throwType, KeySet keys) { 14 super(ts, pos); 15 this.throwType = throwType; 16 this.keys = keys; 17 } 18 19 public KeySet keys() { 20 return keys; 21 } 22 23 public ThrowConstraint keys(KeySet keys) { 24 ThrowConstraint_c n = (ThrowConstraint_c) copy(); 25 n.keys = keys; 26 return n; 27 } 28 29 public Type throwType() { 30 return throwType; 31 } 32 33 public ThrowConstraint throwType(Type throwType) { 34 ThrowConstraint_c n = (ThrowConstraint_c) copy(); 35 n.throwType = throwType; 36 return n; 37 } 38 39 public boolean isCanonical() { 40 return keys.isCanonical() && throwType.isCanonical(); 41 } 42 43 public String toString() { 44 return throwType.toString() + keys.toString(); 45 } 46 } 47 | Popular Tags |