Package org.eclipse.emf.ecore.util

Examples of org.eclipse.emf.ecore.util.InternalEList


    {
      if (eObject.eIsSet(eReference))
      {
        if (eReference.isMany())
        {
          InternalEList source = (InternalEList)eObject.eGet(eReference);
          InternalEList target = (InternalEList)copyEObject.eGet(getTarget(eReference));
          if (source.isEmpty())
          {
            target.clear();
          }
          else
          {
            boolean isBidirectional = eReference.getEOpposite() != null;
            int index = 0;
            for (Iterator k = resolveProxies ? source.iterator() : source.basicIterator(); k.hasNext();)
            {
              Object referencedEObject = k.next();
              Object copyReferencedEObject = get(referencedEObject);
              if (copyReferencedEObject == null)
              {
                if (useOriginalReferences && !isBidirectional)
                {
                  target.addUnique(index, referencedEObject);
                  ++index;
                }
              }
              else
              {
                if (isBidirectional)
                {
                  int position = target.indexOf(copyReferencedEObject);
                  if (position == -1)
                  {
                    target.addUnique(index, copyReferencedEObject);
                  }
                  else if (index != position)
                  {
                    target.move(index, copyReferencedEObject);
                  }
                }
                else
                {
                  target.addUnique(index, copyReferencedEObject);
                }
                ++index;
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.util.InternalEList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.