From ce220abaf5bc19a68ac9038d76c8089109c20cf1 Mon Sep 17 00:00:00 2001 From: Pluemicke Martin Date: Fri, 5 May 2017 14:28:36 +0200 Subject: [PATCH] TypeVar zu subtype von TypePlaceholder gemacht --- .../dhbwstuttgart/strucTypes5/typeVars/TypeVar.java | 13 ++++++------- .../strucTypes5/typeVars/TypeVarInterface.java | 2 +- .../strucTypes5/typeVars/TypeVarType.java | 2 +- .../syntaxtree/type/TypePlaceholder.java | 12 ++++++++++-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVar.java b/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVar.java index f939dfc6..c2523243 100644 --- a/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVar.java +++ b/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVar.java @@ -2,31 +2,30 @@ package de.dhbwstuttgart.strucTypes5.typeVars; import org.antlr.v4.runtime.Token; -import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; +import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; /** * Created by sebastian on 14.04.17. */ -public class TypeVar extends RefTypeOrTPHOrWildcardOrGeneric { +public class TypeVar extends TypePlaceholder { - private String id; + //private String id; public TypeVar(String id) { - super(); - this.id = id; + super(id); } @Override public String toString() { - return String.format("TVar_%s" , id); + return String.format("TVar_%s" , this.getName()); } @Override public boolean equals(Object obj) { if (obj.getClass().equals(TypeVar.class)) { TypeVar t = (TypeVar) obj; - if (t.id.equals(id)) { + if (t.getName().equals(this.getName())) { return true; } else { diff --git a/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVarInterface.java b/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVarInterface.java index 6f46a3e3..679f1baf 100644 --- a/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVarInterface.java +++ b/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVarInterface.java @@ -3,7 +3,7 @@ package de.dhbwstuttgart.strucTypes5.typeVars; import de.dhbwstuttgart.strucTypes5.constraints.InterfaceForConstraint; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; -/** +/** LOESCHEN * Created by sebastian on 30.04.17. */ public class TypeVarInterface extends RefTypeOrTPHOrWildcardOrGeneric { diff --git a/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVarType.java b/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVarType.java index 07aecf81..3e2109f4 100644 --- a/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVarType.java +++ b/src/de/dhbwstuttgart/strucTypes5/typeVars/TypeVarType.java @@ -4,7 +4,7 @@ package de.dhbwstuttgart.strucTypes5.typeVars; import de.dhbwstuttgart.strucTypes4.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; -/** +/**LOESCHEN * Created by sebastian on 14.04.17. */ public class TypeVarType extends RefTypeOrTPHOrWildcardOrGeneric { diff --git a/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java b/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java index 7759fdf8..e432c2b4 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java @@ -18,9 +18,17 @@ public class TypePlaceholder extends RefTypeOrTPHOrWildcardOrGeneric private static Hashtable m_TypePlaceholdersRegistry = new Hashtable(); - private final String name; - + final String name; + /** + * Protected Konstruktor - nur noetig für TypVar + *
Author: Martin Pluemicke + */ + protected TypePlaceholder(String name) + { + super(null); + this.name = name; + } /** * Privater Konstruktor - Eine TypePlaceholder-Variable wird �ber die