org.eclipse.ocl.examples.eventmanager
Class NotificationHelper

java.lang.Object
  extended by org.eclipse.ocl.examples.eventmanager.NotificationHelper

public class NotificationHelper
extends java.lang.Object


Constructor Summary
NotificationHelper()
           
 
Method Summary
static org.eclipse.emf.ecore.EStructuralFeature getNotificationFeature(org.eclipse.emf.common.notify.Notification n)
          Get the EStructuralFeature whose change caused the notification
static boolean isAddEvent(org.eclipse.emf.common.notify.Notification event)
          Checks whether the given event represent an add of a value to the model.
static boolean isAttributeValueChangeEvent(org.eclipse.emf.common.notify.Notification n)
          Checks whether a Notification was caused by an attribute value change.
static boolean isElementLifeCycleEvent(org.eclipse.emf.common.notify.Notification n)
          Checks whether a Notification was caused by an element creation/deletion.
static boolean isLinkLifeCycleEvent(org.eclipse.emf.common.notify.Notification n)
          Checks whether a Notification was caused by a reference change.
static boolean isManyEvent(org.eclipse.emf.common.notify.Notification event)
          Checks whether the given event contains is a Many Event if true, one can handle the old/newValue objects as Lists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationHelper

public NotificationHelper()
Method Detail

isAttributeValueChangeEvent

public static boolean isAttributeValueChangeEvent(org.eclipse.emf.common.notify.Notification n)
Checks whether a Notification was caused by an attribute value change.

Parameters:
n - the Notification to check
Returns:
true if n was caused by an attribute value change, false otherwise

isLinkLifeCycleEvent

public static boolean isLinkLifeCycleEvent(org.eclipse.emf.common.notify.Notification n)
Checks whether a Notification was caused by a reference change.

Parameters:
n - the Notification to check
Returns:
true if n was caused by a reference change, false otherwise

isElementLifeCycleEvent

public static boolean isElementLifeCycleEvent(org.eclipse.emf.common.notify.Notification n)
Checks whether a Notification was caused by an element creation/deletion.

Parameters:
n - the Notification to check
Returns:
true if n was caused by an element creation/deletion, false otherwise

getNotificationFeature

public static org.eclipse.emf.ecore.EStructuralFeature getNotificationFeature(org.eclipse.emf.common.notify.Notification n)
Get the EStructuralFeature whose change caused the notification

Parameters:
n - the Notification to check
Returns:
the EStructuralFeature whose change caused the notification

isManyEvent

public static boolean isManyEvent(org.eclipse.emf.common.notify.Notification event)
Checks whether the given event contains is a Many Event if true, one can handle the old/newValue objects as Lists

Parameters:
event - the Notification to check
Returns:
Boolean true if is a many notification

isAddEvent

public static boolean isAddEvent(org.eclipse.emf.common.notify.Notification event)
Checks whether the given event represent an add of a value to the model.

Parameters:
event - Notification to check
Returns:
true if there is an Notification.ADD or Notification.ADD_MANY or a Notification.SET which set not to null