modified: src/de/dhbwstuttgart/typeinference/result/ResultPair.java

toString() eingefuegt

	modified:   src/de/dhbwstuttgart/typeinference/result/ResultSet.java
toString() eingefuegt

	modified:   src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
int-Lieterals können auch double-Literals sein.

	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
kleien Ausgabeerweiterung
This commit is contained in:
Martin Plümicke 2018-10-12 13:17:59 +02:00
parent 2869f07a58
commit 99bf02606b
4 changed files with 18 additions and 2 deletions

View File

@ -23,4 +23,8 @@ public abstract class ResultPair<A extends RefTypeOrTPHOrWildcardOrGeneric,B ext
public B getRight() {
return right;
}
public String toString() {
return "(" + left.toString() + ", " + right.toString() + ")";
}
}

View File

@ -28,6 +28,10 @@ public class ResultSet {
}
//TODO Beim Einsetzen eines Generics, müssen die new und Methodenaufrufe verändert werden
public String toString() {
return results.toString();
}
}
@ -108,7 +112,7 @@ class Resolver implements ResultSetVisitor {
public void visit(ExtendsWildcardType extendsWildcardType) {
}
}
/**

View File

@ -379,7 +379,14 @@ public class TYPEStmt implements StatementVisitor{
return;
}
if (literal.value instanceof Integer) {
constraintsSet.addUndConstraint(new Pair(literal.getType(), integer, PairOperator.EQUALSDOT));
Set<Constraint> oderConstraints = new HashSet<>();
Constraint constraint = new Constraint();
constraint.add(new Pair(literal.getType(), integer, PairOperator.EQUALSDOT));
oderConstraints.add(constraint);
constraint = new Constraint();
constraint.add(new Pair(literal.getType(), doublee, PairOperator.EQUALSDOT));
oderConstraints.add(constraint);
constraintsSet.addOderConstraint(oderConstraints);
return;
}
if (literal.value instanceof Short) {

View File

@ -597,6 +597,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
writeLog("nextSet: " + nextSet.toString());
writeLog("nextSetasList: " + nextSetasList.toString());
writeLog("Number first erased Elements (undef): " + (len - nofstred));
writeLog("Number second erased Elements (undef): " + (nofstred- nextSetasList.size()));
writeLog("Number erased Elements (undef): " + (len - nextSetasList.size()));
noAllErasedElements = noAllErasedElements + (len - nextSetasList.size());
writeLog("Number of all erased Elements (undef): " + noAllErasedElements.toString());