/** * This method returns all operations of a given Classifier, including inherited * * @param classifier the classifier you want to have the operations for * @return a collection of the operations */ public Collection getOperationsInh(MClassifier classifier) { Collection result = new ArrayList(); result.addAll(getOperations(classifier)); Iterator parents = classifier.getParents().iterator(); while (parents.hasNext()) { result.addAll(getOperationsInh((MClassifier) parents.next())); } return result; }
/** * This method returns all attributes of a given Classifier, including inherited * * @param classifier the classifier you want to have the attributes for * @return a collection of the attributes */ public Collection getAttributesInh(MClassifier classifier) { Collection result = new ArrayList(); result.addAll(getAttributes(classifier)); Iterator parents = classifier.getParents().iterator(); while (parents.hasNext()) { MClassifier parent = (MClassifier) parents.next(); cat.debug("Adding attributes for: " + parent); result.addAll(getAttributesInh(parent)); } return result; }