コード例 #1
0
 @Override
 public boolean sameType(TypeUsage other) {
   if (!other.isReferenceTypeUsage()) {
     return false;
   }
   return getQualifiedName().equals(other.asReferenceTypeUsage().getQualifiedName());
 }
コード例 #2
0
 @Override
 public boolean canBeAssignedTo(TypeUsage type) {
   if (!type.isReferenceTypeUsage()) {
     return false;
   }
   ReferenceTypeUsage other = type.asReferenceTypeUsage();
   if (this.getQualifiedName().equals(other.getQualifiedName())) {
     return true;
   }
   for (TypeUsage ancestor : this.getAllAncestors()) {
     if (ancestor.canBeAssignedTo(type)) {
       return true;
     }
   }
   return false;
 }