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

    label152:
      if (isPessimistic)
      {
        commands.previous();
        while (commands.hasPrevious())
        {
          Command command = (Command)commands.previous();
          command.undo();
        }
      }
      return result;
    }
    isUndoable = false;
    return false;
  }
  
  public void execute()
  {
    if (isPessimistic)
    {
      for (ListIterator<Command> commands = commandList.listIterator(); commands.hasNext();) {
        try
        {
          Command command = (Command)commands.next();
          if (commands.previousIndex() <= rightMostExecutedCommandIndex) {
            command.redo();
          } else {
            command.execute();
          }
        }
        catch (RuntimeException exception)
        {
          commands.previous();
          while (commands.hasPrevious())
          {
            commands.previous();
            Command command = (Command)commands.previous();
            if (!command.canUndo()) {
              break;
            }
            command.undo();
          }
          throw exception;
        }
      }
    }
    else if (!commandList.isEmpty())
    {
      Command command = (Command)commandList.get(commandList.size() - 1);
      command.execute();
    }
  }
  
  public void undo()
  {
    if (isPessimistic)
    {
      super.undo();
    }
    else if (!commandList.isEmpty())
    {
      Command command = (Command)commandList.get(commandList.size() - 1);
      command.undo();
    }
  }
  
  public void redo()
  {
    if (isPessimistic)
    {
      super.redo();
    }
    else if (!commandList.isEmpty())
    {
      Command command = (Command)commandList.get(commandList.size() - 1);
      command.redo();
    }
  }
  
  public boolean appendAndExecute(Command command)
  {
    if (command != null)
    {
      if (!isPrepared) {
        if (commandList.isEmpty())
        {
          isPrepared = true;
          isExecutable = true;
        }
        else
        {
          isExecutable = prepare();
          isPrepared = true;
          isPessimistic = true;
          if (isExecutable) {
            execute();
          }
        }
      }
      if (command.canExecute()) {
        try
        {
          command.execute();
          commandList.add(command);
          rightMostExecutedCommandIndex += 1;
          isUndoable = command.canUndo();
          return true;
        }
        catch (RuntimeException exception)
        {
          CommonPlugin.INSTANCE.log(
            new WrappedException(
            CommonPlugin.INSTANCE.getString("_UI_IgnoreException_exception"), exception).fillInStackTrace());
        }
      }
      command.dispose();
    }
    return false;
  }
  
  public String toString()
  {
    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (isUndoable: " + isUndoable + ")");
    result.append(" (isPessimistic: " + isPessimistic + ")");
    result.append(" (rightMostExecutedCommandIndex: " + rightMostExecutedCommandIndex + ")");
    
    return result.toString();
  }
}

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

import org.eclipse.emf.common.CommonPlugin;

public class UnexecutableCommand
  extends AbstractCommand
{
  public static final UnexecutableCommand INSTANCE = new UnexecutableCommand();
  
  private UnexecutableCommand()
  {
    super(CommonPlugin.INSTANCE.getString("_UI_UnexecutableCommand_label"), CommonPlugin.INSTANCE.getString("_UI_UnexecutableCommand_description"));
  }
  
  public boolean canExecute()
  {
    return false;
  }
  
  public void execute()
  {
    throw 
      new UnsupportedOperationException(
      CommonPlugin.INSTANCE.getString("_EXC_Method_not_implemented", new String[] { getClass().getName() + ".execute()" }));
  }
  
  public boolean canUndo()
  {
    return false;
  }
  
  public void redo()
  {
    throw 
      new UnsupportedOperationException(
      CommonPlugin.INSTANCE.getString("_EXC_Method_not_implemented", new String[] { getClass().getName() + ".redo()" }));
  }
}

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

public abstract interface Adapter$Internal
  extends Adapter
{
  public abstract void unsetTarget(Notifier paramNotifier);
}

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

public abstract interface Adapter
{
  public abstract void notifyChanged(Notification paramNotification);
  
  public abstract Notifier getTarget();
  
  public abstract void setTarget(Notifier paramNotifier);
  
  public abstract boolean isAdapterForType(Object paramObject);
  
  public static abstract interface Internal
    extends Adapter
  {
    public abstract void unsetTarget(Notifier paramNotifier);
  }
}

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

public abstract interface AdapterFactory
{
  public abstract boolean isFactoryForType(Object paramObject);
  
  public abstract Object adapt(Object paramObject1, Object paramObject2);
  
  public abstract Adapter adapt(Notifier paramNotifier, Object paramObject);
  
  public abstract Adapter adaptNew(Notifier paramNotifier, Object paramObject);
  
  public abstract void adaptAllNew(Notifier paramNotifier);
}

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

public abstract interface Notification
{
  @Deprecated
  public static final int CREATE = 0;
  public static final int SET = 1;
  public static final int UNSET = 2;
  public static final int ADD = 3;
  public static final int REMOVE = 4;
  public static final int ADD_MANY = 5;
  public static final int REMOVE_MANY = 6;
  public static final int MOVE = 7;
  public static final int REMOVING_ADAPTER = 8;
  public static final int RESOLVE = 9;
  public static final int EVENT_TYPE_COUNT = 10;
  public static final int NO_FEATURE_ID = -1;
  public static final int NO_INDEX = -1;
  
  public abstract Object getNotifier();
  
  public abstract int getEventType();
  
  public abstract int getFeatureID(Class<?> paramClass);
  
  public abstract Object getFeature();
  
  public abstract Object getOldValue();
  
  public abstract Object getNewValue();
  
  public abstract boolean wasSet();
  
  public abstract boolean isTouch();
  
  public abstract boolean isReset();
  
  public abstract int getPosition();
  
  public abstract boolean merge(Notification paramNotification);
  
  public abstract boolean getOldBooleanValue();
  
  public abstract boolean getNewBooleanValue();
  
  public abstract byte getOldByteValue();
  
  public abstract byte getNewByteValue();
  
  public abstract char getOldCharValue();
  
  public abstract char getNewCharValue();
  
  public abstract double getOldDoubleValue();
  
  public abstract double getNewDoubleValue();
  
  public abstract float getOldFloatValue();
  
  public abstract float getNewFloatValue();
  
  public abstract int getOldIntValue();
  
  public abstract int getNewIntValue();
  
  public abstract long getOldLongValue();
  
  public abstract long getNewLongValue();
  
  public abstract short getOldShortValue();
  
  public abstract short getNewShortValue();
  
  public abstract String getOldStringValue();
  
  public abstract String getNewStringValue();
}

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

public abstract interface NotificationChain
{
  public abstract boolean add(Notification paramNotification);
  
  public abstract void dispatch();
}

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

public class NotificationWrapper
  implements Notification
{
  protected Notification notification;
  protected Object notifier;
  
  public NotificationWrapper(Notification notification)
  {
    this.notification = notification;
  }
  
  public NotificationWrapper(Object notifier, Notification notification)
  {
    this.notifier = notifier;
    this.notification = notification;
  }
  
  public Object getNotifier()
  {
    return notifier == null ? notification.getNotifier() : notifier;
  }
  
  public int getEventType()
  {
    return notification.getEventType();
  }
  
  public int getFeatureID(Class<?> expectedClass)
  {
    return notification.getFeatureID(expectedClass);
  }
  
  public Object getFeature()
  {
    return notification.getFeature();
  }
  
  public Object getOldValue()
  {
    return notification.getOldValue();
  }
  
  public Object getNewValue()
  {
    return notification.getNewValue();
  }
  
  public boolean wasSet()
  {
    return notification.wasSet();
  }
  
  public boolean isTouch()
  {
    return notification.isTouch();
  }
  
  public boolean isReset()
  {
    return notification.isReset();
  }
  
  public int getPosition()
  {
    return notification.getPosition();
  }
  
  public boolean merge(Notification notification)
  {
    return false;
  }
  
  public boolean getOldBooleanValue()
  {
    return notification.getOldBooleanValue();
  }
  
  public boolean getNewBooleanValue()
  {
    return notification.getNewBooleanValue();
  }
  
  public byte getOldByteValue()
  {
    return notification.getOldByteValue();
  }
  
  public byte getNewByteValue()
  {
    return notification.getNewByteValue();
  }
  
  public char getOldCharValue()
  {
    return notification.getOldCharValue();
  }
  
  public char getNewCharValue()
  {
    return notification.getNewCharValue();
  }
  
  public double getOldDoubleValue()
  {
    return notification.getOldDoubleValue();
  }
  
  public double getNewDoubleValue()
  {
    return notification.getNewDoubleValue();
  }
  
  public float getOldFloatValue()
  {
    return notification.getOldFloatValue();
  }
  
  public float getNewFloatValue()
  {
    return notification.getNewFloatValue();
  }
  
  public int getOldIntValue()
  {
    return notification.getOldIntValue();
  }
  
  public int getNewIntValue()
  {
    return notification.getNewIntValue();
  }
  
  public long getOldLongValue()
  {
    return notification.getOldLongValue();
  }
  
  public long getNewLongValue()
  {
    return notification.getNewLongValue();
  }
  
  public short getOldShortValue()
  {
    return notification.getOldShortValue();
  }
  
  public short getNewShortValue()
  {
    return notification.getNewShortValue();
  }
  
  public String getOldStringValue()
  {
    return notification.getOldStringValue();
  }
  
  public String getNewStringValue()
  {
    return notification.getNewStringValue();
  }
}

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

import org.eclipse.emf.common.util.EList;

public abstract interface Notifier
{
  public abstract EList<Adapter> eAdapters();
  
  public abstract boolean eDeliver();
  
  public abstract void eSetDeliver(boolean paramBoolean);
  
  public abstract void eNotify(Notification paramNotification);
}

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

import org.eclipse.emf.common.util.EList;

public abstract interface NotifyingList<E>
  extends EList<E>
{
  public abstract Object getNotifier();
  
  public abstract Object getFeature();
  
  public abstract int getFeatureID();
}

/* Location:
 * Qualified Name:     org.eclipse.emf.common.notify.NotifyingList
 * 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.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;

public class AdapterFactoryImpl
  implements AdapterFactory
{
  public boolean isFactoryForType(Object type)
  {
    return false;
  }
  
  public Object adapt(Object target, Object type)
  {
    if ((target instanceof Notifier)) {
      return adapt((Notifier)target, type);
    }
    return resolve(target, type);
  }
  
  protected Object resolve(Object object, Object type)
  {
    return object;
  }
  
  public Adapter adapt(Notifier target, Object type)
  {
    for (Adapter adapter : target.eAdapters()) {
      if (adapter.isAdapterForType(type)) {
        return adapter;
      }
    }
    return adaptNew(target, type);
  }
  
  public Adapter adaptNew(Notifier target, Object type)
  {
    Adapter adapter = createAdapter(target, type);
    associate(adapter, target);
    return adapter;
  }
  
  public void adaptAllNew(Notifier target)
  {
    Adapter adapter = createAdapter(target);
    associate(adapter, target);
  }
  
  protected Adapter createAdapter(Notifier target, Object type)
  {
    return createAdapter(target);
  }
  
  protected Adapter createAdapter(Notifier target)
  {
    return new AdapterImpl();
  }
  
  protected void associate(Adapter adapter, Notifier target)
  {
    if (adapter != null) {
      target.eAdapters().add(adapter);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.emf.common.notify.impl.AdapterFactoryImpl
 * 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.Internal;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;

public class AdapterImpl
  implements Adapter.Internal
{
  protected Notifier target = null;
  
  public boolean isAdapterForType(Object type)
  {
    return false;
  }
  
  public void notifyChanged(Notification msg) {}
  
  public Notifier getTarget()
  {
    return target;
  }
  
  public void setTarget(Notifier newTarget)
  {
    target = newTarget;
  }
  
  public void unsetTarget(Notifier oldTarget)
  {
    if (target == oldTarget) {
      setTarget(null);
    }
  }
}

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

class BasicNotifierImpl$EAdapterList$1
  extends NotificationImpl
{
  BasicNotifierImpl$EAdapterList$1(BasicNotifierImpl.EAdapterList paramEAdapterList, int $anonymous0, Object $anonymous1, Object $anonymous2, int $anonymous3)
  {
    super($anonymous0, $anonymous1, $anonymous2, $anonymous3);
  }
  
  public Object getNotifier()
  {
    return this$1.notifier;
  }
}

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

import java.util.Collection;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Adapter.Internal;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicEList;

public class BasicNotifierImpl$EAdapterList<E,  extends Adapter>
  extends BasicEList<E>
  implements BasicNotifierImpl.EObservableAdapterList
{
  private static final long serialVersionUID = 1L;
  protected Notifier notifier;
  protected BasicNotifierImpl.EObservableAdapterList.Listener[] listeners;
  protected boolean safe;
  
  public BasicNotifierImpl$EAdapterList(Notifier notifier)
  {
    this.notifier = notifier;
  }
  
  protected boolean canContainNull()
  {
    return false;
  }
  
  protected boolean useEquals()
  {
    return false;
  }
  
  protected Object[] newData(int capacity)
  {
    return new Adapter[capacity];
  }
  
  protected void didAdd(int index, E newObject)
  {
    if (listeners != null)
    {
      BasicNotifierImpl.EObservableAdapterList.Listener[] arrayOfListener;
      int j = (arrayOfListener = listeners).length;
      for (int i = 0; i < j; i++)
      {
        BasicNotifierImpl.EObservableAdapterList.Listener listener = arrayOfListener[i];
        
        listener.added(notifier, newObject);
      }
    }
    ((Adapter)newObject).setTarget(notifier);
  }
  
  protected void didRemove(int index, E oldObject)
  {
    if (listeners != null)
    {
      BasicNotifierImpl.EObservableAdapterList.Listener[] arrayOfListener;
      int j = (arrayOfListener = listeners).length;
      for (int i = 0; i < j; i++)
      {
        BasicNotifierImpl.EObservableAdapterList.Listener listener = arrayOfListener[i];
        
        listener.removed(notifier, oldObject);
      }
    }
    E adapter = oldObject;
    if (notifier.eDeliver())
    {
      Object notification = 
        new NotificationImpl(8, oldObject, null, index)
        {
          public Object getNotifier()
          {
            return notifier;
          }
        };
        ((Adapter)adapter).notifyChanged((Notification)notification);
      }
      if ((adapter instanceof Adapter.Internal)) {
        ((Adapter.Internal)adapter).unsetTarget(notifier);
      } else if (((Adapter)adapter).getTarget() == notifier) {
        ((Adapter)adapter).setTarget(null);
      }
    }
    
    public Object[] data()
    {
      safe = true;
      if ((data != null) && (data.length != size)) {
        if (size == 0)
        {
          data = null;
        }
        else
        {
          Object[] oldData = data;
          data = newData(size);
          System.arraycopy(oldData, 0, data, 0, size);
        }
      }
      return data;
    }
    
    protected void ensureSafety()
    {
      if ((safe) && (data != null))
      {
        Object[] oldData = data;
        data = newData(data.length);
        System.arraycopy(oldData, 0, data, 0, size);
        safe = false;
      }
    }
    
    public boolean add(E object)
    {
      ensureSafety();
      return super.add(object);
    }
    
    public void add(int index, E object)
    {
      ensureSafety();
      super.add(index, object);
    }
    
    public boolean addAll(Collection<? extends E> collection)
    {
      ensureSafety();
      return super.addAll(collection);
    }
    
    public boolean remove(Object object)
    {
      ensureSafety();
      return super.remove(object);
    }
    
    public E remove(int index)
    {
      ensureSafety();
      return (E)super.remove(index);
    }
    
    public boolean removeAll(Collection<?> collection)
    {
      ensureSafety();
      return super.removeAll(collection);
    }
    
    public void clear()
    {
      ensureSafety();
      super.clear();
    }
    
    public boolean retainAll(Collection<?> collection)
    {
      ensureSafety();
      return super.retainAll(collection);
    }
    
    public E set(int index, E object)
    {
      ensureSafety();
      return (E)super.set(index, object);
    }
    
    public void move(int newPosition, E object)
    {
      ensureSafety();
      super.move(newPosition, object);
    }
    
    public E move(int newPosition, int oldPosition)
    {
      ensureSafety();
      return (E)super.move(newPosition, oldPosition);
    }
    
    public void addListener(BasicNotifierImpl.EObservableAdapterList.Listener listener)
    {
      if (listeners == null)
      {
        listeners = new BasicNotifierImpl.EObservableAdapterList.Listener[] { listener };
      }
      else
      {
        BasicNotifierImpl.EObservableAdapterList.Listener[] newListeners = new BasicNotifierImpl.EObservableAdapterList.Listener[listeners.length + 1];
        System.arraycopy(listeners, 0, newListeners, 0, listeners.length);
        newListeners[listeners.length] = listener;
        listeners = newListeners;
      }
    }
    
    public void removeListener(BasicNotifierImpl.EObservableAdapterList.Listener listener)
    {
      if (listeners != null) {
        for (int i = 0; i < listeners.length; i++) {
          if (listeners[i] == listener)
          {
            if (listeners.length == 1)
            {
              listeners = null; break;
            }
            BasicNotifierImpl.EObservableAdapterList.Listener[] newListeners = new BasicNotifierImpl.EObservableAdapterList.Listener[listeners.length - 1];
            System.arraycopy(listeners, 0, newListeners, 0, i);
            if (i != newListeners.length) {
              System.arraycopy(listeners, i + 1, newListeners, i, newListeners.length - i);
            }
            listeners = newListeners;
            
            break;
          }
        }
      }
    }
  }

/* Location:
 * Qualified Name:     org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList
 * 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.notify.Notifier;

public abstract interface BasicNotifierImpl$EObservableAdapterList$Listener
{
  public abstract void added(Notifier paramNotifier, Adapter paramAdapter);
  
  public abstract void removed(Notifier paramNotifier, Adapter paramAdapter);
}

/* Location:
 * Qualified Name:     org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList.Listener
 * 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.notify.Notifier;

public abstract interface BasicNotifierImpl$EObservableAdapterList
{
  public abstract void addListener(Listener paramListener);
  
  public abstract void removeListener(Listener paramListener);
  
  public static abstract interface Listener
  {
    public abstract void added(Notifier paramNotifier, Adapter paramAdapter);
    
    public abstract void removed(Notifier paramNotifier, Adapter paramAdapter);
  }
}

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

import java.util.Collection;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Adapter.Internal;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.ECollections;
import org.eclipse.emf.common.util.EList;

public class BasicNotifierImpl
  implements Notifier
{
  public static class EAdapterList<E,  extends Adapter>
    extends BasicEList<E>
    implements BasicNotifierImpl.EObservableAdapterList
  {
    private static final long serialVersionUID = 1L;
    protected Notifier notifier;
    protected BasicNotifierImpl.EObservableAdapterList.Listener[] listeners;
    protected boolean safe;
    
    public EAdapterList(Notifier notifier)
    {
      this.notifier = notifier;
    }
    
    protected boolean canContainNull()
    {
      return false;
    }
    
    protected boolean useEquals()
    {
      return false;
    }
    
    protected Object[] newData(int capacity)
    {
      return new Adapter[capacity];
    }
    
    protected void didAdd(int index, E newObject)
    {
      if (listeners != null)
      {
        BasicNotifierImpl.EObservableAdapterList.Listener[] arrayOfListener;
        int j = (arrayOfListener = listeners).length;
        for (int i = 0; i < j; i++)
        {
          BasicNotifierImpl.EObservableAdapterList.Listener listener = arrayOfListener[i];
          
          listener.added(notifier, newObject);
        }
      }
      ((Adapter)newObject).setTarget(notifier);
    }
    
    protected void didRemove(int index, E oldObject)
    {
      if (listeners != null)
      {
        BasicNotifierImpl.EObservableAdapterList.Listener[] arrayOfListener;
        int j = (arrayOfListener = listeners).length;
        for (int i = 0; i < j; i++)
        {
          BasicNotifierImpl.EObservableAdapterList.Listener listener = arrayOfListener[i];
          
          listener.removed(notifier, oldObject);
        }
      }
      E adapter = oldObject;
      if (notifier.eDeliver())
      {
        Object notification = 
          new NotificationImpl(8, oldObject, null, index)
          {
            public Object getNotifier()
            {
              return notifier;
            }
          };
          ((Adapter)adapter).notifyChanged((Notification)notification);
        }
        if ((adapter instanceof Adapter.Internal)) {
          ((Adapter.Internal)adapter).unsetTarget(notifier);
        } else if (((Adapter)adapter).getTarget() == notifier) {
          ((Adapter)adapter).setTarget(null);
        }
      }
      
      public Object[] data()
      {
        safe = true;
        if ((data != null) && (data.length != size)) {
          if (size == 0)
          {
            data = null;
          }
          else
          {
            Object[] oldData = data;
            data = newData(size);
            System.arraycopy(oldData, 0, data, 0, size);
          }
        }
        return data;
      }
      
      protected void ensureSafety()
      {
        if ((safe) && (data != null))
        {
          Object[] oldData = data;
          data = newData(data.length);
          System.arraycopy(oldData, 0, data, 0, size);
          safe = false;
        }
      }
      
      public boolean add(E object)
      {
        ensureSafety();
        return super.add(object);
      }
      
      public void add(int index, E object)
      {
        ensureSafety();
        super.add(index, object);
      }
      
      public boolean addAll(Collection<? extends E> collection)
      {
        ensureSafety();
        return super.addAll(collection);
      }
      
      public boolean remove(Object object)
      {
        ensureSafety();
        return super.remove(object);
      }
      
      public E remove(int index)
      {
        ensureSafety();
        return (E)super.remove(index);
      }
      
      public boolean removeAll(Collection<?> collection)
      {
        ensureSafety();
        return super.removeAll(collection);
      }
      
      public void clear()
      {
        ensureSafety();
        super.clear();
      }
      
      public boolean retainAll(Collection<?> collection)
      {
        ensureSafety();
        return super.retainAll(collection);
      }
      
      public E set(int index, E object)
      {
        ensureSafety();
        return (E)super.set(index, object);
      }
      
      public void move(int newPosition, E object)
      {
        ensureSafety();
        super.move(newPosition, object);
      }
      
      public E move(int newPosition, int oldPosition)
      {
        ensureSafety();
        return (E)super.move(newPosition, oldPosition);
      }
      
      public void addListener(BasicNotifierImpl.EObservableAdapterList.Listener listener)
      {
        if (listeners == null)
        {
          listeners = new BasicNotifierImpl.EObservableAdapterList.Listener[] { listener };
        }
        else
        {
          BasicNotifierImpl.EObservableAdapterList.Listener[] newListeners = new BasicNotifierImpl.EObservableAdapterList.Listener[listeners.length + 1];
          System.arraycopy(listeners, 0, newListeners, 0, listeners.length);
          newListeners[listeners.length] = listener;
          listeners = newListeners;
        }
      }
      
      public void removeListener(BasicNotifierImpl.EObservableAdapterList.Listener listener)
      {
        if (listeners != null) {
          for (int i = 0; i < listeners.length; i++) {
            if (listeners[i] == listener)
            {
              if (listeners.length == 1)
              {
                listeners = null; break;
              }
              BasicNotifierImpl.EObservableAdapterList.Listener[] newListeners = new BasicNotifierImpl.EObservableAdapterList.Listener[listeners.length - 1];
              System.arraycopy(listeners, 0, newListeners, 0, i);
              if (i != newListeners.length) {
                System.arraycopy(listeners, i + 1, newListeners, i, newListeners.length - i);
              }
              listeners = newListeners;
              
              break;
            }
          }
        }
      }
    }
    
    public EList<Adapter> eAdapters()
    {
      return ECollections.emptyEList();
    }
    
    protected BasicEList<Adapter> eBasicAdapters()
    {
      return null;
    }
    
    protected Adapter[] eBasicAdapterArray()
    {
      BasicEList<Adapter> eBasicAdapters = eBasicAdapters();
      return eBasicAdapters == null ? null : (Adapter[])eBasicAdapters.data();
    }
    
    protected boolean eBasicHasAdapters()
    {
      BasicEList<Adapter> eBasicAdapters = eBasicAdapters();
      return (eBasicAdapters != null) && (eBasicAdapters.size() != 0);
    }
    
    public boolean eDeliver()
    {
      return false;
    }
    
    public void eSetDeliver(boolean deliver)
    {
      throw new UnsupportedOperationException();
    }
    
    public void eNotify(Notification notification)
    {
      Adapter[] eAdapters = eBasicAdapterArray();
      if ((eAdapters != null) && (eDeliver()))
      {
        int i = 0;
        for (int size = eAdapters.length; i < size; i++) {
          eAdapters[i].notifyChanged(notification);
        }
      }
    }
    
    public boolean eNotificationRequired()
    {
      return (eBasicHasAdapters()) && (eDeliver());
    }
    
    public static abstract interface EObservableAdapterList
    {
      public abstract void addListener(Listener paramListener);
      
      public abstract void removeListener(Listener paramListener);
      
      public static abstract interface Listener
      {
        public abstract void added(Notifier paramNotifier, Adapter paramAdapter);
        
        public abstract void removed(Notifier paramNotifier, Adapter paramAdapter);
      }
    }
  }

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

class DelegatingNotifyingListImpl$1
  extends NotificationImpl
{
  DelegatingNotifyingListImpl$1(DelegatingNotifyingListImpl paramDelegatingNotifyingListImpl, 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$0.getFeature();
  }
  
  public int getFeatureID(Class<?> expectedClass)
  {
    return this$0.getFeatureID(expectedClass);
  }
}

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

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.ListIterator;
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.notify.NotifyingList;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.DelegatingEList;

public abstract class DelegatingNotifyingListImpl<E>
  extends DelegatingEList<E>
  implements NotifyingList<E>
{
  private static final long serialVersionUID = 1L;
  
  public DelegatingNotifyingListImpl() {}
  
  public DelegatingNotifyingListImpl(Collection<? extends E> collection)
  {
    super(collection);
  }
  
  public Object getNotifier()
  {
    return null;
  }
  
  public Object getFeature()
  {
    return null;
  }
  
  public int getFeatureID()
  {
    return -1;
  }
  
  protected int getFeatureID(Class<?> expectedClass)
  {
    return getFeatureID();
  }
  
  protected boolean isSet()
  {
    return !isEmpty();
  }
  
  protected boolean hasInverse()
  {
    return false;
  }
  
  protected boolean canContainNull()
  {
    return !hasInverse();
  }
  
  protected boolean isNotificationRequired()
  {
    return false;
  }
  
  protected boolean hasShadow()
  {
    return false;
  }
  
  protected NotificationChain shadowAdd(E object, NotificationChain notifications)
  {
    return notifications;
  }
  
  protected NotificationChain shadowRemove(E object, NotificationChain notifications)
  {
    return notifications;
  }
  
  protected NotificationChain shadowSet(E oldObject, E newObject, NotificationChain notifications)
  {
    return notifications;
  }
  
  protected NotificationChain inverseAdd(E object, NotificationChain notifications)
  {
    return notifications;
  }
  
  protected NotificationChain inverseRemove(E object, NotificationChain notifications)
  {
    return notifications;
  }
  
  protected NotificationImpl createNotification(int eventType, Object oldObject, Object newObject, int index)
  {
    throw new UnsupportedOperationException("Please change your code to call new five argument version of this method");
  }
  
  protected NotificationImpl createNotification(int eventType, Object oldObject, Object newObject, int index, boolean wasSet)
  {
    
      new NotificationImpl(eventType, oldObject, newObject, index, wasSet)
      {
        public Object getNotifier()
        {
          return DelegatingNotifyingListImpl.this.getNotifier();
        }
        
        public Object getFeature()
        {
          return DelegatingNotifyingListImpl.this.getFeature();
        }
        
        public int getFeatureID(Class<?> expectedClass)
        {
          return DelegatingNotifyingListImpl.this.getFeatureID(expectedClass);
        }
      };
    }
    
    protected NotificationChain createNotificationChain(int capacity)
    {
      return capacity < 100 ? null : new NotificationChainImpl(capacity);
    }
    
    protected void dispatchNotification(Notification notification)
    {
      ((Notifier)getNotifier()).eNotify(notification);
    }
    
    public void addUnique(E object)
    {
      if (isNotificationRequired())
      {
        int index = size();
        boolean oldIsSet = isSet();
        doAddUnique(index, object);
        NotificationImpl notification = createNotification(3, null, object, index, oldIsSet);
        if (hasInverse())
        {
          NotificationChain notifications = inverseAdd(object, null);
          if (hasShadow()) {
            notifications = shadowAdd(object, notifications);
          }
          if (notifications == null)
          {
            dispatchNotification(notification);
          }
          else
          {
            notifications.add(notification);
            notifications.dispatch();
          }
        }
        else
        {
          dispatchNotification(notification);
        }
      }
      else
      {
        doAddUnique(object);
        if (hasInverse())
        {
          NotificationChain notifications = inverseAdd(object, null);
          if (notifications != null) {
            notifications.dispatch();
          }
        }
      }
    }
    
    protected void doAddUnique(E object)
    {
      super.addUnique(object);
    }
    
    public void addUnique(int index, E object)
    {
      if (isNotificationRequired())
      {
        boolean oldIsSet = isSet();
        doAddUnique(index, object);
        NotificationImpl notification = createNotification(3, null, object, index, oldIsSet);
        if (hasInverse())
        {
          NotificationChain notifications = inverseAdd(object, null);
          if (hasShadow()) {
            notifications = shadowAdd(object, notifications);
          }
          if (notifications == null)
          {
            dispatchNotification(notification);
          }
          else
          {
            notifications.add(notification);
            notifications.dispatch();
          }
        }
        else
        {
          dispatchNotification(notification);
        }
      }
      else
      {
        doAddUnique(index, object);
        if (hasInverse())
        {
          NotificationChain notifications = inverseAdd(object, null);
          if (notifications != null) {
            notifications.dispatch();
          }
        }
      }
    }
    
    protected void doAddUnique(int index, E object)
    {
      super.addUnique(index, object);
    }
    
    public boolean addAllUnique(Collection<? extends E> collection)
    {
      return addAllUnique(size(), collection);
    }
    
    protected boolean doAddAllUnique(Collection<? extends E> collection)
    {
      return super.addAllUnique(collection);
    }
    
    public boolean addAllUnique(int index, Collection<? extends E> collection)
    {
      int collectionSize = collection.size();
      if (collectionSize == 0) {
        return false;
      }
      if (isNotificationRequired())
      {
        boolean oldIsSet = isSet();
        doAddAllUnique(index, collection);
        NotificationImpl notification = 
          collectionSize == 1 ? 
          createNotification(3, null, collection.iterator().next(), index, oldIsSet) : 
          createNotification(5, null, collection, 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, collection);
        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, Collection<? extends E> collection)
    {
      return super.addAllUnique(index, collection);
    }
    
    public boolean addAllUnique(Object[] objects, int start, int end)
    {
      return addAllUnique(size(), objects, start, end);
    }
    
    protected boolean doAddAllUnique(Object[] objects, int start, int end)
    {
      return super.addAllUnique(objects, start, end);
    }
    
    public boolean addAllUnique(int index, Object[] objects, int start, int end)
    {
      int collectionSize = end - start;
      if (collectionSize == 0) {
        return false;
      }
      if (isNotificationRequired())
      {
        boolean oldIsSet = isSet();
        doAddAllUnique(index, objects, start, end);
        NotificationImpl notification;
        NotificationImpl notification;
        if (collectionSize == 1)
        {
   
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