org.eclipse.ocl.examples.eventmanager.filters
Class AbstractEventFilter

java.lang.Object
  extended by org.eclipse.ocl.examples.eventmanager.filters.AbstractEventFilter
All Implemented Interfaces:
EventFilter
Direct Known Subclasses:
ClassFilter, ContainmentFilter, EventTypeFilter, LogicalOperationFilterImpl, StructuralFeatureFilter

public abstract class AbstractEventFilter
extends java.lang.Object
implements EventFilter

An EventFilter matches a given specification for the properties of a Notification against an incoming Notification. It is used to pass a Notification specification to an EventManager

Author:
Philipp Berger, Axel Uhl

Constructor Summary
AbstractEventFilter(boolean negated)
          default constructor
 
Method Summary
abstract  AbstractEventFilter clone()
           
abstract  boolean equals(java.lang.Object obj)
           
protected  java.util.Set<org.eclipse.emf.common.notify.Notification> expandNewAndOldValueCollections(org.eclipse.emf.common.notify.Notification n)
          If any of n.getOldValue() and n.getNewValue() is a collection with more than one element, the notification is expanded into one notification per element in the collection.
abstract  java.lang.Object getFilterCriterion()
          Returns the unique property for an AbstractEventFilter object
abstract  int hashCode()
           
 boolean isNegated()
          Returns whether the filter is negated.
 void setNegated(boolean b)
          Sets whether this filter is negated if the filter is negated it will match every Notification which is not matching the intern specification
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.eventmanager.EventFilter
matchesFor
 

Constructor Detail

AbstractEventFilter

public AbstractEventFilter(boolean negated)
default constructor

Parameters:
negated - defines whether the filter is negated
Method Detail

hashCode

public abstract int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public abstract boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getFilterCriterion

public abstract java.lang.Object getFilterCriterion()
Returns the unique property for an AbstractEventFilter object

Specified by:
getFilterCriterion in interface EventFilter

isNegated

public boolean isNegated()
Returns whether the filter is negated. If the filter is negated it will match every Notification which is not matching this filter's regular specification.

Specified by:
isNegated in interface EventFilter
Returns:
true if the filter is negated

clone

public abstract AbstractEventFilter clone()
Specified by:
clone in interface EventFilter
Overrides:
clone in class java.lang.Object

setNegated

public void setNegated(boolean b)
Sets whether this filter is negated if the filter is negated it will match every Notification which is not matching the intern specification

Parameters:
b - true for negating the filter, false for not

expandNewAndOldValueCollections

protected java.util.Set<org.eclipse.emf.common.notify.Notification> expandNewAndOldValueCollections(org.eclipse.emf.common.notify.Notification n)
If any of n.getOldValue() and n.getNewValue() is a collection with more than one element, the notification is expanded into one notification per element in the collection. If both, oldValue and newValue are collections with more than one element, all combinations are produced.