org.eclipse.ocl.examples.eventmanager.filters
Class OldValueClassFilterIncludingSubclasses
java.lang.Object
org.eclipse.ocl.examples.eventmanager.filters.AbstractEventFilter
org.eclipse.ocl.examples.eventmanager.filters.ClassFilter
org.eclipse.ocl.examples.eventmanager.filters.ClassFilterIncludingSubclasses
org.eclipse.ocl.examples.eventmanager.filters.OldValueClassFilterIncludingSubclasses
- All Implemented Interfaces:
- EventFilter
public class OldValueClassFilterIncludingSubclasses
- extends ClassFilterIncludingSubclasses
Matches an event's Notification.getOldValue()
to an EObject.eClass()
and all subclasses of this EClass
. If the new value is a collection then this
filter matches if at least one of the collection's elements 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 OldValueClassFilterIncludingSubclasses
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
with a class Z
that has both, X
and
Y
as its superclasses (multiple inheritance). Assume there is an
AndFiter
with two OldValueClassFilterIncludingSubclasses
s
inside, one matching X
, the other matching Y
. If
only a single element is the old value of a Notification
, the
AndFilter
matches the notification if and only if the old value
conforms to both, X
and Y
, for example if its type
is Z
. However, 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
OldValueClassFilterIncludingSubclasses
matches because of the
X
element, and the second
OldValueClassFilterIncludingSubclasses
matches because of the
Y
element and hence the AndFilter
matches. However, no
single element in the old value collection fulfills both criteria.
- Author:
- Philipp Berger, Axel Uhl
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
OldValueClassFilterIncludingSubclasses
public OldValueClassFilterIncludingSubclasses(org.eclipse.emf.ecore.EClass clazz,
boolean isNegated)
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class ClassFilter
hashCode
public int hashCode()
- Overrides:
hashCode
in class ClassFilterIncludingSubclasses
matchesFor
public boolean matchesFor(org.eclipse.emf.common.notify.Notification event)
- Description copied from interface:
EventFilter
- Tests if the incoming
Notification
matches the intern specification
- Specified by:
matchesFor
in interface EventFilter
- Overrides:
matchesFor
in class ClassFilter
- Parameters:
event
- the Notification
to control
- Returns:
- whether the given
Notification
matches the intern specification
toString
public java.lang.String toString()
- Overrides:
toString
in class ClassFilterIncludingSubclasses
clone
public OldValueClassFilterIncludingSubclasses clone()
- Specified by:
clone
in interface EventFilter
- Overrides:
clone
in class ClassFilterIncludingSubclasses