org.eclipse.ocl.examples.eventmanager.framework
Class TableForEventFilter

java.lang.Object
  extended by org.eclipse.ocl.examples.eventmanager.framework.TableForEventFilter
Direct Known Subclasses:
TableForClassFilter, TableForClassFilterIncludingSubClasses, TableForContainmentFilter, TableForEventTypeFilter, TableForNewValueClassFilter, TableForNewValueClassFilterIncludingSubclasses, TableForOldValueClassFilter, TableForOldValueClassFilterIncludingSubclasses, TableForStructuralFeatureFilter

public abstract class TableForEventFilter
extends java.lang.Object

EventFilterTables are used to connect event filters and Registrations. For each filter type, a special subtype of this class exists which handles exactly all instances of this filter type. It is responsible for computing all possible registration candidates that match an event in the context of the filter type it handles. Additionally it encapsulates the knowledge how to get the necessary information from the passed event (see getAffectedObject(org.eclipse.emf.common.notify.Notification)).

Author:
Daniel Vocke, Axel Uhl

Field Summary
protected  java.util.HashMap<org.eclipse.ocl.examples.eventmanager.framework.Registration,java.lang.Object> filterCriteriaByRegistration
          index which is needed for deregistration purposes
protected  java.util.Map<java.lang.Object,FilterTableEntry> tableEntryByFilterCriterion
          registrations are contained in a FilterTableEntry.
 
Constructor Summary
protected TableForEventFilter(int numberOfFilterTables)
           
 
Method Summary
protected  java.lang.String criterionToString(java.lang.Object criterion)
           
abstract  java.lang.Object getAffectedObject(org.eclipse.emf.common.notify.Notification event)
          This method encapsulates the knowledge which information that is contained by the passed event is of interest in the context of the current EventFilterTable.
 Bag<org.eclipse.ocl.examples.eventmanager.framework.Registration>[] getCompleteNoBag()
          The registrations registered negatedly, grouped by the bit sets representing the set of tables in which the registrations from the set are registered
abstract  java.lang.Class<? extends EventFilter> getIdentifier()
          Each type of TableForEventFilter is directly associated to a filter type, but some MoinEventFilters support additional modifiers that affect the filtering ( for example the includeCompositions flag on InstanceFilterTable or the includeSubclasses flag on ClassFilter).
protected  boolean isEmpty()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

filterCriteriaByRegistration

protected final java.util.HashMap<org.eclipse.ocl.examples.eventmanager.framework.Registration,java.lang.Object> filterCriteriaByRegistration
index which is needed for deregistration purposes


tableEntryByFilterCriterion

protected final java.util.Map<java.lang.Object,FilterTableEntry> tableEntryByFilterCriterion
registrations are contained in a FilterTableEntry. This structure is needed to find the registrations for a filter criterion which is being retrieved by an event.

Constructor Detail

TableForEventFilter

protected TableForEventFilter(int numberOfFilterTables)
Method Detail

getAffectedObject

public abstract java.lang.Object getAffectedObject(org.eclipse.emf.common.notify.Notification event)
This method encapsulates the knowledge which information that is contained by the passed event is of interest in the context of the current EventFilterTable.


criterionToString

protected java.lang.String criterionToString(java.lang.Object criterion)

isEmpty

protected boolean isEmpty()

getIdentifier

public abstract java.lang.Class<? extends EventFilter> getIdentifier()
Each type of TableForEventFilter is directly associated to a filter type, but some MoinEventFilters support additional modifiers that affect the filtering ( for example the includeCompositions flag on InstanceFilterTable or the includeSubclasses flag on ClassFilter). In those cases, there will be more than one instance of the EventFilterTable and in order to be able to determine the right instance for a given MoinEventFilter, both, the MoinEventFilter and the EventFilterTable must implement a getIdentifier() method. The default implementation simply returns its Class, but filters and their tables which support modifying flags return a List containing the Class and all modifiers.

Returns:
an Identifier that allows associating the instance to a filter type.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCompleteNoBag

public Bag<org.eclipse.ocl.examples.eventmanager.framework.Registration>[] getCompleteNoBag()
The registrations registered negatedly, grouped by the bit sets representing the set of tables in which the registrations from the set are registered