From 55f288022aeffeac9e56c5579d74844cfa9dabad Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Mon, 11 Apr 2016 16:31:55 +0200 Subject: [PATCH] commenting, refactoring --- .../typeinference/unify/model/UnifyPair.java | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java b/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java index cdc7b8186..ed2c95eff 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java @@ -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; }