2013-10-18 11:33:46 +00:00
|
|
|
package typinferenz;
|
|
|
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
|
|
import mycompiler.mytype.Pair;
|
|
|
|
import mycompiler.mytype.Type;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stellt ein Constraint dar, welches aus mehreren Constraint-Paaren besteht. Diese gelten alle stets gleichzeitig / sind per "Und" miteinander verknüpft.
|
|
|
|
* @author janulrich
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class UndConstraint extends OderConstraint {
|
|
|
|
|
|
|
|
public UndConstraint(Type p1, Type p2) {
|
|
|
|
super(p1, p2);
|
|
|
|
}
|
|
|
|
|
|
|
|
public UndConstraint() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Vector<UndConstraint> getUndConstraints() {
|
|
|
|
Vector<UndConstraint> ret = new Vector<UndConstraint>();
|
|
|
|
ret.add(this);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-03-18 19:18:57 +00:00
|
|
|
@Override
|
2013-10-18 11:33:46 +00:00
|
|
|
public String toString(){
|
2014-03-18 19:18:57 +00:00
|
|
|
//String ret = super.toString();
|
|
|
|
//return ret.replace('|', ',');
|
|
|
|
String ret = "[";
|
|
|
|
for(Pair p : this.getConstraintPairs()){
|
|
|
|
ret += p.toString()+ ", ";
|
|
|
|
}
|
|
|
|
return ret+"]";
|
2013-10-18 11:33:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|