com.corticon.eclipse.core.util

## Class NotificationBatch

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.ArrayList
      - - com.corticon.eclipse.core.util.NotificationBatch

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

      public class NotificationBatch
      extends java.util.ArrayList

  A notification batch consists of a list of EMF model change notifications, typically all of the notifications that were generated by a single transaction. The class provides convenience methods to test for the presence of particular event types, notifiers, features, old and new values.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NotificationBatch()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.eclipse.emf.common.notify.Notification` | `findFirstAdd(java.lang.Class[] aClassArray)` Return the first ADD notification where the new value is an instance of the specified class.
    `org.eclipse.emf.common.notify.Notification` | `findLastRemove(java.lang.Class[] aClassArray)` Return the last REMOVE notification where the old value is an instance of the specified class.
    `java.util.List` | `getAllUniqueResources()` Accessor method for all Resources affected by this batch.
    `java.lang.Object` | `getContainerForFeature(org.eclipse.emf.ecore.ENamedElement[] aENamedElementArray, java.lang.Class aClassContainer)` Given an array of features, locate a notification that matches any of those features.
    `java.lang.Object` | `getContainerForFeature(org.eclipse.emf.ecore.ENamedElement aENamedElement, java.lang.Class aClassContainer)` Given a feature, locate the first notification that matches that feature.
    `java.lang.Object` | `getContainerForNotifier(java.lang.Class[] aClassNotifierArray, java.lang.Class aClassContainer)` Given an array of notifier classes, return the first container of that notifier that matches the specified type.
    `java.lang.Object` | `getContainerForNotifier(java.lang.Class aClassNotifier, java.lang.Class aClassContainer)` Given a notifier class, return the first container of that notifier that matches the specified type.
    `org.eclipse.emf.common.notify.Notification` | `getNotificationForFeature(org.eclipse.emf.ecore.ENamedElement aENamedElement)` Given a feature, locate the first notification that matches that feature.
    `org.eclipse.emf.common.notify.Notification` | `getNotificationForFeatureAndEvent(org.eclipse.emf.ecore.ENamedElement aENamedElement, int eventType)` Given a feature and eventType, locate the first notification that matches that feature and event type.
    `org.eclipse.emf.common.notify.Notification` | `getNotificationForNotifierAndFeature(java.lang.Object aObjectNotifier, org.eclipse.emf.ecore.ENamedElement aENamedElement)` Given a feature and event type, locate the first matching notification.
    `org.eclipse.emf.common.notify.Notification` | `getNotificationForNotifierFeatureEvent(java.lang.Object aObjectNotifier, org.eclipse.emf.ecore.ENamedElement aENamedElement, int aiEventType)` Given a notifier, feature and event type, locate the first matching notification.
    `java.util.List<org.eclipse.emf.common.notify.Notification>` | `getNotificationsForEvent(int eventType)` Given a feature and eventType, locate the first notification that matches that feature and event type.
    `org.eclipse.emf.ecore.resource.Resource` | `getResource()` Accessor method for last Resource affected by this batch.
    `boolean` | `hasAdd(org.eclipse.emf.ecore.ENamedElement aENamedElementParent, org.eclipse.emf.ecore.ENamedElement aENamedElementChild)` Return `true` if the notification batch has an ADD event for the specified parent and child (new value).
    `boolean` | `hasChildNotifiers(java.lang.Object aObjectParent, java.lang.Class aClassChild)` Return `true` if the notification batch has any instances of a specified class that are children of a specified parent instance.
    `boolean` | `hasChildNotifiers(java.lang.Object aObjectParent, java.lang.Class aClassChild, boolean abIncludeParent)` Return `true` if the notification batch has any instances of a specified class that are children of a specified parent instance, or optionally, exactly match the parent instance.
    `boolean` | `hasEventType(int aiEventType)`
    `boolean` | `hasFeatures(java.lang.Object[] aObjectArray)` Return `true` if the notification batch has any instances of the specified features.
    `boolean` | `hasNewValues(java.lang.Class[] aClassArray)` Return `true` if the notification batch has any instances of the specified new value classes.
    `boolean` | `hasNotifiers(java.lang.Class[] aClassArray)` Return `true` if the notification batch has any instances of the specified notifiers.
    `boolean` | `hasNotifiers(java.lang.Object[] aObjectArray)` Return `true` if the notification batch has any of the specific instances as notifiers.
    `boolean` | `hasOldValues(java.lang.Class[] aClassArray)` Return `true` if the notification batch has any instances of the specified old value classes.
    `boolean` | `hasRemove(org.eclipse.emf.ecore.ENamedElement aENamedElementParent, org.eclipse.emf.ecore.ENamedElement aENamedElementChild)` Return `true` if the notification batch has a REMOVE event for the specified parent and child (old value).

    - ### Methods inherited from class java.util.ArrayList

      `add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize`

    - ### Methods inherited from class java.util.AbstractList

      `equals, hashCode`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.List

      `containsAll, equals, hashCode`

- - ### Constructor Detail

    - #### NotificationBatch

          public NotificationBatch()

  - ### Method Detail

    - #### getNotificationForFeature

          public org.eclipse.emf.common.notify.Notification getNotificationForFeature(org.eclipse.emf.ecore.ENamedElement aENamedElement)

      Given a feature, locate the first notification that matches that feature.
      Parameters:
        `aENamedElement` - Feature being updated.
      Returns:
        Notification object or `null`

    - #### getNotificationForFeatureAndEvent

          public org.eclipse.emf.common.notify.Notification getNotificationForFeatureAndEvent(org.eclipse.emf.ecore.ENamedElement aENamedElement,
                                                                                     int eventType)

      Given a feature and eventType, locate the first notification that matches that feature and event type.
      Parameters:
        `aENamedElement` - Feature being updated.
        `eventType` - type of event performed
      Returns:
        Notification object or `null`

    - #### getNotificationsForEvent

          public java.util.List<org.eclipse.emf.common.notify.Notification> getNotificationsForEvent(int eventType)

      Given a feature and eventType, locate the first notification that matches that feature and event type.
      Parameters:
        `aENamedElement` - Feature being updated.
        `eventType` - type of event performed
      Returns:
        Notification object or `null`

    - #### getNotificationForNotifierAndFeature

          public org.eclipse.emf.common.notify.Notification getNotificationForNotifierAndFeature(java.lang.Object aObjectNotifier,
                                                                                        org.eclipse.emf.ecore.ENamedElement aENamedElement)

      Given a feature and event type, locate the first matching notification.
      Parameters:
        `aObjectNotifier` - Notifier object.
        `aENamedElement` - Feature being updated.
      Returns:
        Notification object or `null`.

    - #### getNotificationForNotifierFeatureEvent

          public org.eclipse.emf.common.notify.Notification getNotificationForNotifierFeatureEvent(java.lang.Object aObjectNotifier,
                                                                                          org.eclipse.emf.ecore.ENamedElement aENamedElement,
                                                                                          int aiEventType)

      Given a notifier, feature and event type, locate the first matching notification.
      Parameters:
        `aObjectNotifier` - Notifier object.
        `aENamedElement` - Feature being updated.
        `aiEventType` - Type of event.
      Returns:
        Notification object or `null`.

    - #### getContainerForFeature

          public java.lang.Object getContainerForFeature(org.eclipse.emf.ecore.ENamedElement aENamedElement,
                                                java.lang.Class aClassContainer)

      Given a feature, locate the first notification that matches that feature. change (if any) that matches the specified type.
      Parameters:
        `aENamedElement` - Feature being updated.
        `aClassContainer` - Container class.
      Returns:
        Container object or `null`

    - #### getContainerForFeature

          public java.lang.Object getContainerForFeature(org.eclipse.emf.ecore.ENamedElement[] aENamedElementArray,
                                                java.lang.Class aClassContainer)

      Given an array of features, locate a notification that matches any of those features. When that notification is found, locate the instance of the class container that encapsulates the object that was changed.
      Parameters:
        `aENamedElementArray` - Array of features.
        `aClassContainer` - Container class.
      Returns:
        Container object or `null`

    - #### getContainerForNotifier

          public java.lang.Object getContainerForNotifier(java.lang.Class aClassNotifier,
                                                 java.lang.Class aClassContainer)

      Given a notifier class, return the first container of that notifier that matches the specified type.
      Parameters:
        `aClassNotifier` - Class of notifier to test.
        `aClassContainer` - Container class.
      Returns:
        Container object or `null`

    - #### getContainerForNotifier

          public java.lang.Object getContainerForNotifier(java.lang.Class[] aClassNotifierArray,
                                                 java.lang.Class aClassContainer)

      Given an array of notifier classes, return the first container of that notifier that matches the specified type.
      Parameters:
        `aClassNotifierArray` - Array of notifier classes.
        `aClassContainer` - Container class.
      Returns:
        Container object or `null`

    - #### getResource

          public org.eclipse.emf.ecore.resource.Resource getResource()

      Accessor method for last Resource affected by this batch.
      Returns:
        Resource associated with notification batch or `null`.

    - #### getAllUniqueResources

          public java.util.List getAllUniqueResources()

      Accessor method for all Resources affected by this batch.
      Returns:
        Resource associated with notification batch or `null`.

    - #### hasChildNotifiers

          public boolean hasChildNotifiers(java.lang.Object aObjectParent,
                                  java.lang.Class aClassChild)

      Return `true` if the notification batch has any instances of a specified class that are children of a specified parent instance.
      Parameters:
        `aObjectParent` - Parent object instance.
        `aClassChild` - Child class.
      Returns:
        `true` if any instance of the child class are children of parent object.

    - #### hasChildNotifiers

          public boolean hasChildNotifiers(java.lang.Object aObjectParent,
                                  java.lang.Class aClassChild,
                                  boolean abIncludeParent)

      Return `true` if the notification batch has any instances of a specified class that are children of a specified parent instance, or optionally, exactly match the parent instance.
      Parameters:
        `aObjectParent` - Parent object instance.
        `aClassChild` - Child class.
        `abIncludeParent` - `true` to include parent in test.
      Returns:
        `true` if any instance of the child class are children of parent object.

    - #### hasNewValues

          public boolean hasNewValues(java.lang.Class[] aClassArray)

      Return `true` if the notification batch has any instances of the specified new value classes.
      Parameters:
        `aClassArray` - of classes to test.
      Returns:
        `true` if notification batch contains any of the specified new values.

    - #### hasOldValues

          public boolean hasOldValues(java.lang.Class[] aClassArray)

      Return `true` if the notification batch has any instances of the specified old value classes.
      Parameters:
        `aClassArray` - of classes to test.
      Returns:
        `true` if notification batch contains any of the specified old values.

    - #### hasNotifiers

          public boolean hasNotifiers(java.lang.Class[] aClassArray)

      Return `true` if the notification batch has any instances of the specified notifiers.
      Parameters:
        `aClassArray` - of classes to test.
      Returns:
        `true` if notification batch contains any of the specified notifiers.

    - #### hasFeatures

          public boolean hasFeatures(java.lang.Object[] aObjectArray)

      Return `true` if the notification batch has any instances of the specified features.
      Parameters:
        `aObjectArray` - Array of features to test.
      Returns:
        `true` if notification batch contains any of the specified features.

    - #### hasEventType

          public boolean hasEventType(int aiEventType)

    - #### hasNotifiers

          public boolean hasNotifiers(java.lang.Object[] aObjectArray)

      Return `true` if the notification batch has any of the specific instances as notifiers.
      Parameters:
        `aObjectArray` - Array of objects to test.
      Returns:
        `true` if notification batch contains any of the specified notifiers.

    - #### findFirstAdd

          public org.eclipse.emf.common.notify.Notification findFirstAdd(java.lang.Class[] aClassArray)

      Return the first ADD notification where the new value is an instance of the specified class.
      Parameters:
        `aClassArray` - of classes to test.
      Returns:
        `true` if notification batch contains any of the specified notifiers.

    - #### findLastRemove

          public org.eclipse.emf.common.notify.Notification findLastRemove(java.lang.Class[] aClassArray)

      Return the last REMOVE notification where the old value is an instance of the specified class.
      Parameters:
        `Class[]` - Array of classes to test.
      Returns:
        `true` if notification batch contains any of the specified notifiers.

    - #### hasAdd

          public boolean hasAdd(org.eclipse.emf.ecore.ENamedElement aENamedElementParent,
                       org.eclipse.emf.ecore.ENamedElement aENamedElementChild)

      Return `true` if the notification batch has an ADD event for the specified parent and child (new value).
      Parameters:
        `aENamedElementParent` - Parent object.
        `aENamedElementChild` - Child object.

    - #### hasRemove

          public boolean hasRemove(org.eclipse.emf.ecore.ENamedElement aENamedElementParent,
                          org.eclipse.emf.ecore.ENamedElement aENamedElementChild)

      Return `true` if the notification batch has a REMOVE event for the specified parent and child (old value).
      Parameters:
        `aENamedElementParent` - Parent object.
        `aENamedElementChild` - Child object.

Copyright © 2005-2013 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.