added wildcardtype

This commit is contained in:
Florian Steurer 2016-04-04 10:18:34 +02:00
parent 2c642cb6ef
commit 2e30429252

View File

@ -0,0 +1,34 @@
package de.dhbwstuttgart.typeinference.unify.model;
public abstract class WildcardType extends UnifyType {
protected UnifyType wildcardedType;
protected WildcardType(String name, UnifyType wildcardedType, UnifyType[] typeParams) {
super(name, typeParams);
this.wildcardedType = wildcardedType;
}
protected WildcardType(String name, UnifyType wildcardedType, TypeParams p) {
super(name, p);
this.wildcardedType = wildcardedType;
}
public UnifyType getWildcardedType() {
return wildcardedType;
}
@Override
public int hashCode() {
return wildcardedType.hashCode() + getName().hashCode() + 17;
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof WildcardType))
return false;
WildcardType other = (WildcardType) obj;
return other.getWildcardedType().equals(wildcardedType);
}
}