EList eFeatures = aEClass.getEStructuralFeatures();
Iterator iter = eFeatures.iterator();
List uimaFeatures = new ArrayList();
while (iter.hasNext()) {
EStructuralFeature eFeat = (EStructuralFeature) iter.next();
FeatureDescription uimaFeat = eStructuralFeature2UimaFeature(eFeat, aOptions);
uimaFeatures.add(uimaFeat);
}
// copy down features from additional supertypes
for (int i = 1; i < supertypes.size(); i++) {
EClass copyFrom = (EClass) supertypes.get(i);
EList copyFeatures = copyFrom.getEStructuralFeatures();
Iterator iter2 = copyFeatures.iterator();
while (iter2.hasNext()) {
EStructuralFeature eFeat = (EStructuralFeature) iter2.next();
// do not copy if this feature is a duplicate of one defined on the class
// or inherited from its primary supertype
EList locallyDefinedFeatures = aEClass.getEStructuralFeatures();
EList firstSupertypesFeatures = ((EClass) supertypes.get(0)).getEAllStructuralFeatures();
if (!containsNamedElement(locallyDefinedFeatures, eFeat.getName())
&& !containsNamedElement(firstSupertypesFeatures, eFeat.getName())) {
FeatureDescription uimaFeat = eStructuralFeature2UimaFeature(eFeat, aOptions);
uimaFeatures.add(uimaFeat);
}
}
}