/** * Retrieves the first of the specified objects that matches the criteria * used by the specified matcher. * * @param iterator * The iterator for the candidate objects. * @param filter * The matcher to be used. * @return The first object that matches the criteria. */ public static EObject findEObject(Iterator<? extends EObject> iterator, EObjectMatcher filter) { while (iterator.hasNext()) { EObject eObject = iterator.next(); if (filter.matches(eObject)) { return eObject; } } return null; }
.getTargetDirectedRelationships(UMLPackage.Literals.TEMPLATE_BINDING)) { if (matcher.matches(relationship) && ownedTypes.containsAll(relationship .getSources())) {
/** * Retrieves the first of the specified objects that matches the criteria * used by the specified matcher. * * @param iterator * The iterator for the candidate objects. * @param filter * The matcher to be used. * @return The first object that matches the criteria. */ public static EObject findEObject(Iterator<? extends EObject> iterator, EObjectMatcher filter) { while (iterator.hasNext()) { EObject eObject = iterator.next(); if (filter.matches(eObject)) { return eObject; } } return null; }