commenting, refactoring

This commit is contained in:
Florian Steurer 2016-04-11 16:31:55 +02:00
parent 0313d297e1
commit 55f288022a

View File

@ -1,31 +1,55 @@
package de.dhbwstuttgart.typeinference.unify.model;
/**
* A pair which contains two types and an operator, e.q. (Integer <. a).
* @author Florian Steurer
*/
public class UnifyPair {
/**
* The type on the left hand side of the pair.
*/
private UnifyType lhs;
/**
* The type on the right hand side of the pair.
*/
private UnifyType rhs;
/**
* The operator that determines the relation between the left and right hand side type.
*/
private PairOperator pairOp;
/*public MPair(Type t1, Type t2) {
lhs = t1;
rhs = t2;
pairOp = PairOperator.SMALLER;
}*/
public UnifyPair(UnifyType t1, UnifyType t2, PairOperator op) {
lhs = t1;
rhs = t2;
/**
* Creates a new instance of the pair.
* @param lhs The type on the left hand side of the pair.
* @param rhs The type on the right hand side of the pair.
* @param op The operator that determines the relation between the left and right hand side type.
*/
public UnifyPair(UnifyType lhs, UnifyType rhs, PairOperator op) {
this.lhs = lhs;
this.rhs = rhs;
pairOp = op;
}
/**
* Returns the type on the left hand side of the pair.
*/
public UnifyType getLhsType() {
return lhs;
}
/**
* Returns the type on the right hand side of the pair.
*/
public UnifyType getRhsType() {
return rhs;
}
/**
* Returns the operator that determines the relation between the left and right hand side type.
*/
public PairOperator getPairOp() {
return pairOp;
}