@Override public boolean matches(EObject otherEObject) { return super.matches(otherEObject) && safeEquals(eObject.eGet(eStructuralFeature), otherEObject .eGet(eStructuralFeature)); } }
@Override public boolean matches(EObject otherEObject) { return super.matches(otherEObject) && safeEquals(eObject.eGet(eStructuralFeature), otherEObject .eGet(eStructuralFeature)); } }
/** * Queries whether the specified <code>instance</code> has slots for the * given <code>properties</code> that have these <code>values</code>. * * @param instance * an instance specification * @param properties * a list of properties * @param values * values to look for in the slots of the instance defined by the * given properties * * @return <code>true</code> if this instance has the matching property * values; <code>false</code>, otherwise */ private boolean match(InstanceSpecification instance, List<Property> properties, List<?> values) { int found = 0; for (Slot slot : instance.getSlots()) { int index = properties.indexOf(slot.getDefiningFeature()); if (index >= 0) { Object actualValue = getValue(slot); if (UML2Util.safeEquals(actualValue, values.get(index))) { found++; } } } return found == properties.size(); }