@Override public void collectMembers(List<Member> mbrs, List<StructPart> alreadySeen) { if (alreadySeen.contains(this)) { return; } alreadySeen.add(this); mbrs.addAll(getMembers()); if (!getSuperTypes().isEmpty()) { for (StructPart superType : getSuperTypes()) { superType.collectMembers(mbrs, alreadySeen); } } }
@Override public boolean isSubtypeOf(StructPart part) { if (!getSuperTypes().isEmpty()) { for (StructPart superType : getSuperTypes()) { if (superType.equals(part)) { return true; } } for (StructPart superType : getSuperTypes()) { if (superType.isSubtypeOf(part)) return true; } return false; } else { return false; } }