Created
June 18, 2010 10:01
-
-
Save louismrose/443458 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Currently type is checked against the name of each class directly | |
public Collection<EObject> getAllOfType(String type) throws EolModelElementTypeNotFoundException { | |
... | |
if (allOfType == null || !cachingEnabled){ | |
allOfType = new ArrayList<EObject>(); | |
for (EObject eObject : allContents()) { | |
if (eObject.eClass().getName().equals(type) || getFullyQualifiedName(eObject.eClass()).equals(type)){ | |
allOfType.add(eObject); | |
eClass = eObject.eClass(); | |
} | |
} | |
} | |
... | |
} | |
// But perhaps we could use classForName instead? | |
// classForName uses getFullyQualifiedName if the type contains at least one occurrence of "::" | |
public Collection<EObject> getAllOfType(String type) throws EolModelElementTypeNotFoundException { | |
... | |
EClass eClass = classForName(type); | |
if (allOfType == null || !cachingEnabled){ | |
allOfType = new ArrayList<EObject>(); | |
for (EObject eObject : allContents()) { | |
if (eObject.eClass().getName().equals(eClass.getName())) { | |
allOfType.add(eObject); | |
} | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment