/** * Test if a possibleSub eclass is a sub eclass * * @param aclass, cannot be null * @param possibleSubClasse, cannot be null * @return true if possible eclass is a subtype of a eclass or false */ public boolean isSubClass(EClassifier aclass, EClass possibleSubClasse) { if (aclass.equals(possibleSubClasse)) { return true; } EList<EClass> superTypeList = possibleSubClasse.getEAllSuperTypes(); if (superTypeList.contains(aclass)) { return true; } return false; }
@Override public boolean equals(final Object obj) { if (this == obj) return true; if (!(obj instanceof EClassAttributeMatch)) { // this should be infrequent if (obj == null) return false; if (!(obj instanceof IPatternMatch)) return false; IPatternMatch otherSig = (IPatternMatch) obj; if (!pattern().equals(otherSig.pattern())) return false; return Arrays.deepEquals(toArray(), otherSig.toArray()); } EClassAttributeMatch other = (EClassAttributeMatch) obj; if (fE == null) { if (other.fE != null) return false; } else if (!fE.equals(other.fE)) return false; if (fAttr == null) { if (other.fAttr != null) return false; } else if (!fAttr.equals(other.fAttr)) return false; if (fType == null) { if (other.fType != null) return false; } else if (!fType.equals(other.fType)) return false; return true; }