TypeVar zu subtype von TypePlaceholder gemacht

This commit is contained in:
Pluemicke Martin 2017-05-05 14:28:36 +02:00
parent f48bb2ac0c
commit ce220abaf5
4 changed files with 18 additions and 11 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -18,9 +18,17 @@ public class TypePlaceholder extends RefTypeOrTPHOrWildcardOrGeneric
private static Hashtable<String, TypePlaceholder> m_TypePlaceholdersRegistry = new Hashtable<String, TypePlaceholder>();
private final String name;
final String name;
/**
* Protected Konstruktor - nur noetig für TypVar
* <br>Author: Martin Pluemicke
*/
protected TypePlaceholder(String name)
{
super(null);
this.name = name;
}
/**
* Privater Konstruktor - Eine TypePlaceholder-Variable wird �ber die