public class OldValueClassFilter extends ClassFilter
Notification.getOldValue()
to an
EObject.eClass()
. An exact match, not considering any inheritance
relations, is required. If the new value
is a collection, e.g., because several elements were removed from a
many-feature at once, this filter matches if at least one of the elements'
class is matched.
When several such filters are combined in an AndFilter
, the
AndFilter
matches if all of its operand filters match. This does not
require the individual OldValueClassFilter
s to match based on the
same element in case the old value happens to be a collection. For example,
assume there are two classes X
and Y
. Assume there
is an AndFilter
with two OldValueClassFilter
s inside, one
matching X
, the other matching Y
. If there are two
elements in the old value collection of the Notification
, one of type
X
and the other of type Y
, the first
OldValueClassFilter
matches because of the X
element,
and the second OldValueClassFilter
matches because of the
Y
element and hence the AndFilter
matches. However, no
single element in the old value collection fulfills both criteria.
wantedClass
Constructor and Description |
---|
OldValueClassFilter(org.eclipse.emf.ecore.EClass clazz,
boolean isNegated) |
Modifier and Type | Method and Description |
---|---|
OldValueClassFilter |
clone() |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
matchesFor(org.eclipse.emf.common.notify.Notification event)
Tests if the incoming
Notification matches the intern specification |
java.lang.String |
toString() |
getFilterCriterion, getWantedClass, matches
expandNewAndOldValueCollections, isNegated, setNegated
public OldValueClassFilter(org.eclipse.emf.ecore.EClass clazz, boolean isNegated)
public boolean equals(java.lang.Object obj)
equals
in class ClassFilter
public int hashCode()
hashCode
in class ClassFilter
public boolean matchesFor(org.eclipse.emf.common.notify.Notification event)
EventFilter
Notification
matches the intern specificationmatchesFor
in interface EventFilter
matchesFor
in class ClassFilter
event
- the Notification
to controlNotification
matches the intern specificationpublic java.lang.String toString()
toString
in class ClassFilter
public OldValueClassFilter clone()
clone
in interface EventFilter
clone
in class ClassFilter