org.eclipse.emf.common_2.7.0.v20120127-1122

       notification = createNotification(3, null, objects[0], index, oldIsSet);
        }
        else
        {
          NotificationImpl notification;
          if ((start != 0) || (end != objects.length))
          {
            Object[] actualObjects = new Object[collectionSize];
            int i = 0;
            for (int j = start; j < end; j++)
            {
              actualObjects[i] = objects[j];i++;
            }
            notification = createNotification(5, null, Arrays.asList(actualObjects), index, oldIsSet);
          }
          else
          {
            notification = createNotification(5, null, Arrays.asList(objects), index, oldIsSet);
          }
        }
        if (hasInverse())
        {
          NotificationChain notifications = createNotificationChain(collectionSize);
          int lastIndex = index + collectionSize;
          for (int i = index; i < lastIndex; i++)
          {
            E value = delegateGet(i);
            notifications = inverseAdd(value, notifications);
            notifications = shadowAdd(value, notifications);
          }
          if (notifications == null)
          {
            dispatchNotification(notification);
          }
          else
          {
            notifications.add(notification);
            notifications.dispatch();
          }
        }
        else
        {
          dispatchNotification(notification);
        }
      }
      else
      {
        doAddAllUnique(index, objects, start, end);
        if (hasInverse())
        {
          NotificationChain notifications = createNotificationChain(collectionSize);
          int lastIndex = index + collectionSize;
          for (int i = index; i < lastIndex; i++) {
            notifications = inverseAdd(delegateGet(i), notifications);
          }
          if (notifications != null) {
            notifications.dispatch();
          }
        }
      }
      return true;
    }
    
    protected boolean doAddAllUnique(int index, Object[] objects, int start, int end)
    {
      return super.addAllUnique(index, objects, start, end);
    }
    
    public NotificationChain basicAdd(E object, NotificationChain notifications)
    {
      if (isNotificationRequired())
      {
        int index = size();
        boolean oldIsSet = isSet();
        doAddUnique(index, object);
        NotificationImpl notification = createNotification(3, null, object, index, oldIsSet);
        if (notifications == null) {
          notifications = notification;
        } else {
          notifications.add(notification);
        }
      }
      else
      {
        doAddUnique(size(), object);
      }
      return notifications;
    }
    
    public E remove(int index)
    {
      if (isNotificationRequired())
      {
        NotificationChain notifications = null;
        boolean oldIsSet = isSet();
        if (hasShadow()) {
          notifications = shadowRemove(basicGet(index), null);
        }
        E oldObject;
        NotificationImpl notification = createNotification(4, oldObject = doRemove(index), null, index, oldIsSet);
        if ((hasInverse()) && (oldObject != null))
        {
          notifications = inverseRemove(oldObject, notifications);
          if (notifications == null)
          {
            dispatchNotification(notification);
          }
          else
          {
            notifications.add(notification);
            notifications.dispatch();
          }
        }
        else if (notifications == null)
        {
          dispatchNotification(notification);
        }
        else
        {
          notifications.add(notification);
          notifications.dispatch();
        }
        return oldObject;
      }
      E oldObject = doRemove(index);
      if ((hasInverse()) && (oldObject != null))
      {
        NotificationChain notifications = inverseRemove(oldObject, null);
        if (notifications != null) {
          notifications.dispatch();
        }
      }
      return oldObject;
    }
    
    protected E doRemove(int index)
    {
      return (E)super.remove(index);
    }
    
    public boolean removeAll(Collection<?> collection)
    {
      boolean oldIsSet = isSet();
      
      boolean result = false;
      int[] positions = (int[])null;
      if (isNotificationRequired())
      {
        int listSize = collection.size();
        if (listSize > 0)
        {
          NotificationChain notifications = createNotificationChain(listSize);
          
          BasicEList<Object> list = new BasicEList(collection);
          Object[] objects = list.data();
          positions = new int[listSize];
          int count = 0;
          if (isUnique())
          {
            for (ListIterator<E> i = delegateListIterator(); i.hasNext();)
            {
              E initialObject = i.next();
              E object = initialObject;
              for (int repeat = 0; repeat < 2; repeat++)
              {
                int j = listSize;
                do
                {
                  if (equalObjects(object, objects[j]))
                  {
                    if (count != j)
                    {
                      Object x = objects[count];
                      objects[count] = objects[j];
                      objects[j] = x;
                    }
                    positions[(count++)] = i.previousIndex();
                    break;
                  }
                  j--;
                } while (j >= 0);
                object = resolve(object);
                if (object == initialObject) {
                  break;
                }
              }
            }
          }
          else
          {
            BasicEList<Object> resultList = new BasicEList(listSize);
            for (ListIterator<E> i = delegateListIterator(); i.hasNext();)
            {
              E initialObject = i.next();
              E object = initialObject;
              for (int repeat = 0; repeat < 2; repeat++)
              {
                int j = listSize;
                do
                {
                  if (equalObjects(object, objects[j]))
                  {
                    if (positions.length <= count)
                    {
                      int[] oldPositions = positions;
                      positions = new int[2 * positions.length];
                      System.arraycopy(oldPositions, 0, positions, 0, count);
                    }
                    positions[(count++)] = i.previousIndex();
                    resultList.add(objects[j]);
                    break;
                  }
                  j--;
                } while (j >= 0);
                object = resolve(object);
                if (object == initialObject) {
                  break;
                }
              }
            }
            list = resultList;
            objects = resultList.data();
            listSize = count;
            if (count > positions.length)
            {
              int[] oldPositions = positions;
              positions = new int[count];
              System.arraycopy(oldPositions, 0, positions, 0, count);
            }
          }
          if (count > 0)
          {
            result = true;
            if (hasShadow()) {
              for (int i = 0; i < count; i++)
              {
                E object = objects[i];
                notifications = shadowRemove(object, notifications);
              }
            }
            int i = count;
            do
            {
              doRemove(positions[i]);i--;
            } while (i >= 0);
            if (count != listSize)
            {
              int i = listSize;
              do
              {
                list.remove(i);i--;
              } while (i >= count);
              int[] oldPositions = positions;
              positions = new int[count];
              System.arraycopy(oldPositions, 0, positions, 0, count);
            }
            collection = list;
          }
        }
      }
      else
      {
        collection = getDuplicates(collection);
        
        int i = delegateSize();
        do
        {
          if (collection.contains(delegateGet(i)))
          {
            doRemove(i);
            result = true;
          }
          i--;
        } while (i >= 0);
      }
      if (result)
      {
        if (positions != null)
        {
          int collectionSize = collection.size();
          NotificationImpl notification = 
            collectionSize == 1 ? 
            createNotification(4, collection.iterator().next(), null, positions[0], oldIsSet) : 
            createNotification(6, collection, positions, positions[0], oldIsSet);
          
          NotificationChain notifications = createNotificationChain(collectionSize);
          if (hasInverse())
          {
            for (Iterator<?> i = collection.iterator(); i.hasNext();)
            {
              E object = i.next();
              notifications = inverseRemove(object, notifications);
            }
            if (notifications == null)
            {
              dispatchNotification(notification);
            }
            else
            {
              notifications.add(notification);
              notifications.dispatch();
            }
          }
          else if (notifications == null)
          {
            dispatchNotification(notification);
          }
          else
          {
            notifications.add(notification);
            notifications.dispatch();
          }
        }
        else if (hasInverse())
        {
          NotificationChain notifications = createNotificationChain(collection.size());
          for (Iterator<?> i = collection.iterator(); i.hasNext();)
          {
            E object = i.next();
            notifications = inverseRemove(object, notifications);
          }
          if (notifications != null) {
            notifications.dispatch();
          }
        }
        return true;
      }
      return false;
    }
    
    protected E resolve(E object)
    {
      return object;
    }
    
    protected boolean doRemoveAll(Collection<?> collection)
    {
      return super.removeAll(collection);
    }
    
    public NotificationChain basicRemove(Object object, NotificationChain notifications)
    {
      int index = indexOf(object);
      if (index != -1) {
        if (isNotificationRequired())
        {
          boolean oldIsSet = isSet();
          Object oldObject = doRemove(index);
          NotificationImpl notification = createNotification(4, oldObject, null, index, oldIsSet);
          if (notifications == null) {
            notifications = notification;
          } else {
            notifications.add(notification);
          }
        }
        else
        {
          doRemove(index);
        }
      }
      return notifications;
    }
    
    public void clear()
    {
      if (isNotificationRequired())
      {
        int size = size();
        boolean oldIsSet = isSet();
        if (size > 0)
        {
          BasicEList<E> collection = new BasicEList(basicList());
          int collectionSize = size;
          
          NotificationChain notifications = createNotificationChain(collectionSize);
          if (hasShadow()) {
            for (int i = 0; i < size; i++) {
              notifications = shadowRemove(collection.get(i), notifications);
            }
          }
          doClear(collectionSize, collection.data());
          Notification notification = 
            collectionSize == 1 ? 
            createNotification(4, collection.get(0), null, 0, oldIsSet) : 
            createNotification(6, collection, null, -1, oldIsSet);
          if (hasInverse())
          {
            for (Iterator<E> i = collection.iterator(); i.hasNext();) {
              notifications = inverseRemove(i.next(), notifications);
            }
            if (notifications == null)
            {
              dispatchNotification(notification);
            }
            else
            {
              notifications.add(notification);
              notifications.dispatch();
            }
          }
          else if (notifications == null)
          {
            dispatchNotification(notification);
          }
          else
          {
            notifications.add(notification);
            notifications.dispatch();
          }
        }
        else
        {
          doClear();
          dispatchNotification(createNotification(6, Collections.EMPTY_LIST, null, -1, oldIsSet));
        }
      }
      else if (hasInverse())
      {
        int size = size();
        if (size > 0)
        {
          Object[] oldData = delegateToArray();
          int oldSize = size;
          doClear(size, oldData);
          NotificationChain notifications = createNotificationChain(oldSize);
          for (int i = 0; i < oldSize; i++)
          {
            E object = oldData[i];
            notifications = inverseRemove(object, notifications);
          }
          if (notifications != null) {
            notifications.dispatch();
          }
        }
        else
        {
          doClear();
        }
      }
      else
      {
        doClear();
      }
    }
    
    protected void doClear()
    {
      super.clear();
    }
    
    public E setUnique(int index, E object)
    {
      if (isNotificationRequired())
      {
        NotificationChain notifications = null;
        boolean oldIsSet = isSet();
        E oldObject;
        Notification notification = createNotification(1, oldObject = doSetUnique(index, object), object, index, oldIsSet);
        if ((hasInverse()) && (!equalObjects(oldObject, object)))
        {
          if (oldObject != null) {
            notifications = inverseRemove(oldObject, notifications);
          }
          notifications = inverseAdd(object, notifications);
          if (hasShadow()) {
            notifications = shadowSet(oldObject, object, notifications);
          }
          if (notifications == null)
          {
            dispatchNotification(notification);
          }
          else
          {
            notifications.add(notification);
            notifications.dispatch();
          }
        }
        else
        {
          if (hasShadow()) {
            notifications = shadowSet(oldObject, object, notifications);
          }
          if (notifications == null)
          {
            dispatchNotification(notification);
          }
          else
          {
            notifications.add(notification);
            notifications.dispatch();
          }
        }
        return oldObject;
      }
      E oldObject = doSetUnique(index, object);
      if ((hasInverse()) && (!equalObjects(oldObject, object)))
      {
        NotificationChain notifications = null;
        if (oldObject != null) {
          notifications = inverseRemove(oldObject, null);
        }
        notifications = inverseAdd(object, notifications);
        if (notifications != null) {
          notifications.dispatch();
        }
      }
      return oldObject;
    }
    
    protected E doSetUnique(int index, E object)
    {
      return (E)super.setUnique(index, object);
    }
    
    public NotificationChain basicSet(int index, E object, NotificationChain notifications)
    {
      if (isNotificationRequired())
      {
        boolean oldIsSet = isSet();
        NotificationImpl notification = 
          createNotification(1, doSetUnique(index, object), object, index, oldIsSet);
        if (notifications == null) {
          notifications = notification;
        } else {
          notifications.add(notification);
        }
      }
      else
      {
        doSetUnique(index, object);
      }
      return notifications;
    }
    
    public E move(int targetIndex, int sourceIndex)
    {
      if (isNotificationRequired())
      {
        boolean oldIsSet = isSet();
        E object = doMove(targetIndex, sourceIndex);
        dispatchNotification(
          createNotification(
          7, 
          Integer.valueOf(sourceIndex), 
          object, 
          targetIndex, 
          oldIsSet));
        return object;
      }
      return (E)doMove(targetIndex, sourceIndex);
    }
    
    protected E doMove(int targetIndex, int sourceIndex)
    {
      return (E)super.move(targetIndex, sourceIndex);
    }
  }

/* Location:
 * Qualified Name:     org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.common.notify.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicEList;

public class NotificationChainImpl
  extends BasicEList<Notification>
  implements NotificationChain
{
  private static final long serialVersionUID = 1L;
  
  public NotificationChainImpl() {}
  
  public NotificationChainImpl(int initialCapacity)
  {
    super(initialCapacity);
  }
  
  protected Object[] newData(int capacity)
  {
    return new Notification[capacity];
  }
  
  public boolean add(Notification newNotification)
  {
    if (newNotification == null) {
      return false;
    }
    for (int i = 0; i < size; i++)
    {
      Notification notification = (Notification)data[i];
      if (notification.merge(newNotification)) {
        return false;
      }
    }
    return super.add(newNotification);
  }
  
  public void dispatch()
  {
    for (int i = 0; i < size; i++)
    {
      Notification notification = (Notification)data[i];
      dispatch(notification);
    }
  }
  
  protected void dispatch(Notification notification)
  {
    Object notifier = notification.getNotifier();
    if ((notifier != null) && (notification.getEventType() != -1)) {
      ((Notifier)notifier).eNotify(notification);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.common.notify.impl.NotificationChainImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.common.notify.impl;

import java.util.List;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicEList;

public class NotificationImpl
  implements Notification, NotificationChain
{
  public static final int PRIMITIVE_TYPE_OBJECT = -1;
  public static final int PRIMITIVE_TYPE_BOOLEAN = 0;
  public static final int PRIMITIVE_TYPE_BYTE = 1;
  public static final int PRIMITIVE_TYPE_CHAR = 2;
  public static final int PRIMITIVE_TYPE_DOUBLE = 3;
  public static final int PRIMITIVE_TYPE_FLOAT = 4;
  public static final int PRIMITIVE_TYPE_INT = 5;
  public static final int PRIMITIVE_TYPE_LONG = 6;
  public static final int PRIMITIVE_TYPE_SHORT = 7;
  protected static final int IS_SET_CHANGE_INDEX = -2;
  protected int primitiveType;
  protected int eventType;
  protected Object oldValue;
  protected Object newValue;
  protected long oldSimplePrimitiveValue;
  protected long newSimplePrimitiveValue;
  protected double oldIEEEPrimitiveValue;
  protected double newIEEEPrimitiveValue;
  protected int position;
  protected NotificationChain next;
  
  public NotificationImpl(int eventType, Object oldValue, Object newValue)
  {
    this(eventType, oldValue, newValue, -1);
  }
  
  public NotificationImpl(int eventType, Object oldValue, Object newValue, boolean isSetChange)
  {
    this(eventType, oldValue, newValue, isSetChange ? -2 : -1);
  }
  
  public NotificationImpl(int eventType, Object oldValue, Object newValue, int position)
  {
    this.eventType = eventType;
    this.oldValue = oldValue;
    this.newValue = newValue;
    this.position = position;
    primitiveType = -1;
  }
  
  public NotificationImpl(int eventType, Object oldValue, Object newValue, int position, boolean wasSet)
  {
    this.eventType = eventType;
    this.oldValue = oldValue;
    this.newValue = newValue;
    this.position = position;
    primitiveType = -1;
    if (!wasSet) {
      this.position = (-2 - position - 1);
    }
  }
  
  public NotificationImpl(int eventType, boolean oldBooleanValue, boolean newBooleanValue, boolean isSetChange)
  {
    this(eventType, oldBooleanValue, newBooleanValue);
    if (isSetChange) {
      position = -2;
    }
  }
  
  public NotificationImpl(int eventType, boolean oldBooleanValue, boolean newBooleanValue)
  {
    this.eventType = eventType;
    oldSimplePrimitiveValue = (oldBooleanValue ? 1 : 0);
    newSimplePrimitiveValue = (newBooleanValue ? 1 : 0);
    position = -1;
    primitiveType = 0;
  }
  
  public NotificationImpl(int eventType, byte oldByteValue, byte newByteValue, boolean isSetChange)
  {
    this(eventType, oldByteValue, newByteValue);
    if (isSetChange) {
      position = -2;
    }
  }
  
  public NotificationImpl(int eventType, byte oldByteValue, byte newByteValue)
  {
    this.eventType = eventType;
    oldSimplePrimitiveValue = oldByteValue;
    newSimplePrimitiveValue = newByteValue;
    position = -1;
    primitiveType = 1;
  }
  
  public NotificationImpl(int eventType, char oldCharValue, char newCharValue, boolean isSetChange)
  {
    this(eventType, oldCharValue, newCharValue);
    if (isSetChange) {
      position = -2;
    }
  }
  
  public NotificationImpl(int eventType, char oldCharValue, char newCharValue)
  {
    this.eventType = eventType;
    oldSimplePrimitiveValue = oldCharValue;
    newSimplePrimitiveValue = newCharValue;
    position = -1;
    primitiveType = 2;
  }
  
  public NotificationImpl(int eventType, double oldDoubleValue, double newDoubleValue, boolean isSetChange)
  {
    this(eventType, oldDoubleValue, newDoubleValue);
    if (isSetChange) {
      position = -2;
    }
  }
  
  public NotificationImpl(int eventType, double oldDoubleValue, double newDoubleValue)
  {
    this.eventType = eventType;
    oldIEEEPrimitiveValue = oldDoubleValue;
    newIEEEPrimitiveValue = newDoubleValue;
    position = -1;
    primitiveType = 3;
  }
  
  public NotificationImpl(int eventType, float oldFloatValue, float newFloatValue, boolean isSetChange)
  {
    this(eventType, oldFloatValue, newFloatValue);
    if (isSetChange) {
      position = -2;
    }
  }
  
  public NotificationImpl(int eventType, float oldFloatValue, float newFloatValue)
  {
    this.eventType = eventType;
    oldIEEEPrimitiveValue = oldFloatValue;
    newIEEEPrimitiveValue = newFloatValue;
    position = -1;
    primitiveType = 4;
  }
  
  public NotificationImpl(int eventType, int oldIntValue, int newIntValue, boolean isSetChange)
  {
    this(eventType, oldIntValue, newIntValue);
    if (isSetChange) {
      position = -2;
    }
  }
  
  public NotificationImpl(int eventType, int oldIntValue, int newIntValue)
  {
    this.eventType = eventType;
    oldSimplePrimitiveValue = oldIntValue;
    newSimplePrimitiveValue = newIntValue;
    position = -1;
    primitiveType = 5;
  }
  
  public NotificationImpl(int eventType, long oldLongValue, long newLongValue, boolean isSetChange)
  {
    this(eventType, oldLongValue, newLongValue);
    if (isSetChange) {
      position = -2;
    }
  }
  
  public NotificationImpl(int eventType, long oldLongValue, long newLongValue)
  {
    this.eventType = eventType;
    oldSimplePrimitiveValue = oldLongValue;
    newSimplePrimitiveValue = newLongValue;
    position = -1;
    primitiveType = 6;
  }
  
  public NotificationImpl(int eventType, short oldShortValue, short newShortValue, boolean isSetChange)
  {
    this(eventType, oldShortValue, newShortValue);
    if (isSetChange) {
      position = -2;
    }
  }
  
  public NotificationImpl(int eventType, short oldShortValue, short newShortValue)
  {
    this.eventType = eventType;
    oldSimplePrimitiveValue = oldShortValue;
    newSimplePrimitiveValue = newShortValue;
    position = -1;
    primitiveType = 7;
  }
  
  public Object getNotifier()
  {
    return null;
  }
  
  public int getEventType()
  {
    return eventType;
  }
  
  public Object getFeature()
  {
    return null;
  }
  
  public int getFeatureID(Class<?> expectedClass)
  {
    return -1;
  }
  
  public Object getOldValue()
  {
    if (oldValue == null) {
      switch (primitiveType)
      {
      case 0: 
        oldValue = (getOldBooleanValue() ? Boolean.TRUE : Boolean.FALSE);
        break;
      case 1: 
        oldValue = Byte.valueOf(getOldByteValue());
        break;
      case 2: 
        oldValue = Character.valueOf(getOldCharValue());
        break;
      case 3: 
        oldValue = Double.valueOf(getOldDoubleValue());
        break;
      case 4: 
        oldValue = Float.valueOf(getOldFloatValue());
        break;
      case 6: 
        oldValue = Long.valueOf(getOldLongValue());
        break;
      case 5: 
        oldValue = Integer.valueOf(getOldIntValue());
        break;
      case 7: 
        oldValue = Short.valueOf(getOldShortValue());
      }
    }
    return oldValue;
  }
  
  public Object getNewValue()
  {
    if (newValue == null) {
      switch (primitiveType)
      {
      case 0: 
        newValue = (getNewBooleanValue() ? Boolean.TRUE : Boolean.FALSE);
        break;
      case 1: 
        newValue = Byte.valueOf(getNewByteValue());
        break;
      case 2: 
        newValue = Character.valueOf(getNewCharValue());
        break;
      case 3: 
        newValue = Double.valueOf(getNewDoubleValue());
        break;
      case 4: 
        newValue = Float.valueOf(getNewFloatValue());
        break;
      case 6: 
        newValue = Long.valueOf(getNewLongValue());
        break;
      case 5: 
        newValue = Integer.valueOf(getNewIntValue());
        break;
      case 7: 
        newValue = Short.valueOf(getNewShortValue());
      }
    }
    return newValue;
  }
  
  public boolean isTouch()
  {
    switch (eventType)
    {
    case 8: 
    case 9: 
      return true;
    case 3: 
    case 4: 
    case 5: 
    case 6: 
      return false;
    case 7: 
      return ((Integer)getOldValue()).intValue() == position;
    case 1: 
    case 2: 
      if (position == -2) {
        return false;
      }
      switch (primitiveType)
      {
      case 0: 
      case 1: 
      case 2: 
      case 5: 
      case 6: 
      case 7: 
        return oldSimplePrimitiveValue == newSimplePrimitiveValue;
      case 3: 
      case 4: 
        return oldIEEEPrimitiveValue == newIEEEPrimitiveValue;
      }
      return oldValue == null ? false : newValue == null ? true : oldValue.equals(newValue);
    }
    return false;
  }
  
  public boolean isReset()
  {
    switch (eventType)
    {
    case 1: 
      Object defaultValue = getFeatureDefaultValue();
      switch (primitiveType)
      {
      case 0: 
        if (defaultValue != null) {
          if (((Boolean)defaultValue).booleanValue() == (newSimplePrimitiveValue != 0L)) {
            return true;
          }
        }
        return false;
      case 1: 
        return (defaultValue != null) && (((Byte)defaultValue).byteValue() == (byte)(int)newSimplePrimitiveValue);
      case 2: 
        return (defaultValue != null) && (((Character)defaultValue).charValue() == (char)(int)newSimplePrimitiveValue);
      case 6: 
        return (defaultValue != null) && (((Long)defaultValue).longValue() == newSimplePrimitiveValue);
      case 5: 
        return (defaultValue != null) && (((Integer)defaultValue).intValue() == (int)newSimplePrimitiveValue);
      case 7: 
        return (defaultValue != null) && (((Short)defaultValue).shortValue() == (short)(int)newSimplePrimitiveValue);
      case 3: 
        return (defaultValue != null) && (((Double)defaultValue).doubleValue() == newIEEEPrimitiveValue);
      case 4: 
        return (defaultValue != null) && (((Float)defaultValue).floatValue() == (float)newIEEEPrimitiveValue);
      }
      return defaultValue == null ? false : newValue == null ? true : defaultValue.equals(newValue);
    case 2: 
      return true;
    }
    return false;
  }
  
  public boolean wasSet()
  {
    switch (eventType)
    {
    case 1: 
      if (isFeatureUnsettable()) {
        return position != -2;
      }
      break;
    case 2: 
      if (isFeatureUnsettable()) {
        return position == -2;
      }
      break;
    case 3: 
    case 4: 
    case 5: 
    case 6: 
    case 7: 
      return position > -2;
    default: 
      return false;
    }
    Object defaultValue = getFeatureDefaultValue();
    switch (primitiveType)
    {
    case 0: 
      if (defaultValue != null) {
        if (((Boolean)defaultValue).booleanValue() != (oldSimplePrimitiveValue != 0L)) {
          return true;
        }
      }
      return false;
    case 1: 
      return (defaultValue != null) && (((Byte)defaultValue).byteValue() != (byte)(int)oldSimplePrimitiveValue);
    case 2: 
      return (defaultValue != null) && (((Character)defaultValue).charValue() != (char)(int)oldSimplePrimitiveValue);
    case 6: 
      return (defaultValue != null) && (((Long)defaultValue).longValue() != oldSimplePrimitiveValue);
    case 5: 
      return (defaultValue != null) && (((Integer)defaultValue).intValue() != (int)oldSimplePrimitiveValue);
    case 7: 
      return (defaultValue != null) && (((Short)defaultValue).shortValue() != (short)(int)oldSimplePrimitiveValue);
    case 3: 
      return (defaultValue != null) && (((Double)defaultValue).doubleValue() != oldIEEEPrimitiveValue);
    case 4: 
      return (defaultValue != null) && (((Float)defaultValue).floatValue() != (float)oldIEEEPrimitiveValue);
    }
    return oldValue != null;
  }
  
  protected boolean isFeatureUnsettable()
  {
    return false;
  }
  
  protected Object getFeatureDefaultValue()
  {
    return null;
  }
  
  public int getPosition()
  {
    return position < 0 ? -1 : position < -2 ? -2 - position - 1 : position;
  }
  
  public boolean merge(Notification notification)
  {
    switch (eventType)
    {
    case 1: 
    case 2: 
      int notificationEventType = notification.getEventType();
      switch (notificationEventType)
      {
      case 1: 
      case 2: 
        Object notificationNotifier = notification.getNotifier();
        if ((notificationNotifier == getNotifier()) && (getFeatureID(null) == notification.getFeatureID(null)))
        {
          newValue = notification.getNewValue();
          if (notification.getEventType() == 1) {
            eventType = 1;
          }
          return true;
        }
        break;
      }
    case 4: 
      int notificationEventType = notification.getEventType();
      switch (notificationEventType)
      {
      case 4: 
        Object notificationNotifier = notification.getNotifier();
        if ((notificationNotifier == getNotifier()) && (getFeatureID(null) == notification.getFeatureID(null)))
        {
          boolean originalWasSet = wasSet();
          int originalPosition = getPosition();
          int notificationPosition = notification.getPosition();
          
          eventType = 6;
          BasicEList<Object> removedValues = new BasicEList(2);
          if (originalPosition <= notificationPosition)
          {
            removedValues.add(oldValue);
            removedValues.add(notification.getOldValue());
            newValue = new int[] { position = originalPosition, notificationPosition + 1 };
          }
          else
          {
            removedValues.add(notification.getOldValue());
            removedValues.add(oldValue);
            newValue = new int[] { position = notificationPosition, originalPosition };
          }
          oldValue = removedValues;
          if (!originalWasSet) {
            position = (-2 - position - 1);
          }
          return true;
        }
        break;
      }
      break;
    case 6: 
      int notificationEventType = notification.getEventType();
      switch (notificationEventType)
      {
      case 4: 
        Object notificationNotifier = notification.getNotifier();
        if ((notificationNotifier == getNotifier()) && (getFeatureID(null) == notification.getFeatureID(null)))
        {
          boolean originalWasSet = wasSet();
          int notificationPosition = notification.getPosition();
          
          int[] positions = (int[])newValue;
          int[] newPositions = new int[positions.length + 1];
          
          int index = 0;
          while (index < positions.length)
          {
            int oldPosition = positions[index];
            if (oldPosition > notificationPosition) {
              break;
            }
            newPositions[(index++)] = oldPosition;
            notificationPosition++;
          }
          List<Object> list = (List)oldValue;
          list.add(index, notification.getOldValue());
          newPositions[index] = notificationPosition;
          do
          {
            newPositions[index] = positions[(index - 1)];index++;
          } while (index < newPositions.length);
          newValue = newPositions;
          if (!originalWasSet) {
            position = (-2 - newPositions[0]);
          }
          return true;
        }
        break;
      }
      break;
    }
    return false;
  }
  
  public boolean getOldBooleanValue()
  {
    if (primitiveType != 0) {
      throw new IllegalStateException();
    }
    return oldSimplePrimitiveValue != 0L;
  }
  
  public boolean getNewBooleanValue()
  {
    if (primitiveType != 0) {
      throw new IllegalStateException();
    }
    return newSimplePrimitiveValue != 0L;
  }
  
  public byte getOldByteValue()
  {
    if (primitiveType != 1) {
      throw new IllegalStateException();
    }
    return (byte)(int)oldSimplePrimitiveValue;
  }
  
  public byte getNewByteValue()
  {
    if (primitiveType != 1) {
      throw new IllegalStateException();
    }
    return (byte)(int)newSimplePrimitiveValue;
  }
  
  public char getOldCharValue()
  {
    if (primitiveType != 2) {
      throw new IllegalStateException();
    }
    return (char)(int)oldSimplePrimitiveValue;
  }
  
  public char getNewCharValue()
  {
    if (primitiveType != 2) {
      throw new IllegalStateException();
    }
    return (char)(int)newSimplePrimitiveValue;
  }
  
  public double getOldDoubleValue()
  {
    if (primitiveType != 3) {
      throw new IllegalStateException();
    }
    return oldIEEEPrimitiveValue;
  }
  
  public double getNewDoubleValue()
  {
    if (primitiveType != 3) {
      throw new IllegalStateException();
    }
    return newIEEEPrimitiveValue;
  }
  
  public float getOldFloatValue()
  {
    if (primitiveType != 4) {
      throw new IllegalStateException();
    }
    return (float)oldIEEEPrimitiveValue;
  }
  
  public float getNewFloatValue()
  {
    if (primitiveType != 4) {
      throw new IllegalStateException();
    }
    return (float)newIEEEPrimitiveValue;
  }
  
  public int getOldIntValue()
  {
    if (primitiveType != 5) {
      throw new IllegalStateException();
    }
    return (int)oldSimplePrimitiveValue;
  }
  
  public int getNewIntValue()
  {
    if (primitiveType != 5) {
      throw new IllegalStateException();
    }
    return (int)newSimplePrimitiveValue;
  }
  
  public long getOldLongValue()
  {
    if (primitiveType != 6) {
      throw new IllegalStateException();
    }
    return oldSimplePrimitiveValue;
  }
  
  public long getNewLongValue()
  {
    if (primitiveType != 6) {
      throw new IllegalStateException();
    }
    return newSimplePrimitiveValue;
  }
  
  public short getOldShortValue()
  {
    if (primitiveType != 7) {
      throw new IllegalStateException();
    }
    return (short)(int)oldSimplePrimitiveValue;
  }
  
  public short getNewShortValue()
  {
    if (primitiveType != 7) {
      throw new IllegalStateException();
    }
    return (short)(int)newSimplePrimitiveValue;
  }
  
  public String getOldStringValue()
  {
    return oldValue == null ? null : oldValue.toString();
  }
  
  public String getNewStringValue()
  {
    return newValue == null ? null : newValue.toString();
  }
  
  public boolean add(Notification newNotification)
  {
    if (newNotification == null) {
      return false;
    }
    if (merge(newNotification)) {
      return false;
    }
    if (next == null)
    {
      if ((newNotification instanceof NotificationImpl))
      {
        next = ((NotificationImpl)newNotification);
        return true;
      }
      next = new NotificationChainImpl();
      return next.add(newNotification);
    }
    return next.add(newNotification);
  }
  
  public void dispatch()
  {
    Object notifier = getNotifier();
    if ((notifier != null) && (getEventType() != -1)) {
      ((Notifier)notifier).eNotify(this);
    }
    if (next != null) {
      next.dispatch();
    }
  }
  
  public String toString()
  {
    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (eventType: ");
    switch (eventType)
    {
    case 1: 
      result.append("SET");
      break;
    case 2: 
      result.append("UNSET");
      break;
    case 3: 
      result.append("ADD");
      break;
    case 5: 
      result.append("ADD_MANY");
      break;
    case 4: 
      result.append("REMOVE");
      break;
    case 6: 
      result.append("REMOVE_MANY");
      break;
    case 7: 
      result.append("MOVE");
      break;
    case 8: 
      result.append("REMOVING_ADAPTER");
      break;
    case 9: 
      result.append("RESOLVE");
      break;
    default: 
      result.append(eventType);
    }
    if (isTouch()) {
      result.append(", touch: true");
    }
    result.append(", position: ");
    result.append(getPosition());
    result.append(", notifier: ");
    result.append(getNotifier());
    result.append(", feature: ");
    result.append(getFeature());
    result.append(", oldValue: ");
    result.append(getOldValue());
    result.append(", newValue: ");
    if ((eventType == 6) && ((newValue instanceof int[])))
    {
      int[] positions = (int[])newValue;
      result.append("[");
      for (int i = 0; i < positions.length;)
      {
        result.append(positions[i]);
        i++;
        if (i < positions.length) {
          result.append(", ");
        }
      }
      result.append("]");
    }
    else
    {
      result.append(getNewValue());
    }
    result.append(", isTouch: ");
    result.append(isTouch());
    result.append(", wasSet: ");
    result.append(wasSet());
    result.append(")");
    
    return result.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.common.notify.impl.NotificationImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.common.notify.impl;

import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;

public class NotifierImpl
  extends BasicNotifierImpl
{
  protected static final int EDELIVER = 1;
  protected static final int ELAST_NOTIFIER_FLAG = 1;
  protected int eFlags = 1;
  protected BasicEList<Adapter> eAdapters;
  
  public EList<Adapter> eAdapters()
  {
    if (eAdapters == null) {
      eAdapters = new BasicNotifierImpl.EAdapterList(this);
    }
    return eAdapters;
  }
  
  protected BasicEList<Adapter> eBasicAdapters()
  {
    return eAdapters;
  }
  
  public boolean eDeliver()
  {
    return (eFlags & 0x1) != 0;
  }
  
  public void eSetDeliver(boolean deliver)
  {
    if (deliver) {
      eFlags |= 0x1;
    } else {
      eFlags &= 0xFFFFFFFE;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.common.notify.impl.NotifierImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.emf.common.notify.impl;

class NotifyingListImpl$1
  extends NotificationImpl
{
  NotifyingListImpl$1(NotifyingListImpl paramNotifyingListImpl, int $anonymous0, Object $anonymous1, Object $anonymous2, int $anonymous3, boolean $anonymous4)
  {
    super($anonymous0, $anonymous1, $anonymous2, $anonymous3, $anonymous4);
  }
  
  public Object getNotifier()
  {
    return this$0.getNotifier();
  }
  
  public Object getFeature()
  {
    return this
1 2 3 4 5 6 7 8 9 10 11 12

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd