added wildcardtype
This commit is contained in:
parent
2c642cb6ef
commit
2e30429252
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user