Examples of EGenericType


Examples of org.eclipse.emf.ecore.EGenericType

    return eGenericType;
  }

  protected EGenericType createEGenericType(ETypeParameter eTypeParameter)
  {
    EGenericType eGenericType = ecoreFactory.createEGenericType();
    eGenericType.setETypeParameter(eTypeParameter);
    return eGenericType;
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

    return eGenericType;
  }

  protected EGenericType createEGenericType(EClassifier eClassifier)
  {
    EGenericType eGenericType = ecoreFactory.createEGenericType();
    eGenericType.setEClassifier(eClassifier);
    return eGenericType;
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

          }
         
          @Override
          public EGenericType move(int targetIndex, int sourceIndex)
          {
            EGenericType result = super.move(targetIndex, sourceIndex);
            if (isNotificationRequired())
            {
              dispatchNotification
                (new ENotificationImpl
                   (EClassImpl.this,
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

        public void eliminateEquivalentDuplicates()
        {
          EGenericType [] eGenericTypes  = (EGenericType[])data;
          for (int i = size - 1; i >= 0; --i)
          {
            EGenericType eGenericType = eGenericTypes[i];
            for (int j = 0; j < i; ++j)
            {
              EGenericType otherEGenericType = eGenericTypes[j];
              if (equivalent(eGenericType, otherEGenericType))
              {
                remove(i);
                break;
              }
            }
          }
        }

        public boolean equivalent(EGenericType eGenericType, EGenericType otherEGenericType)
        {
          if (eGenericType == otherEGenericType)
          {
            return true;
          }
          else
          {
            eGenericType = resolve(eGenericType);
            otherEGenericType = resolve(otherEGenericType);
            EClassifier eClassifier = eGenericType.getEClassifier();
            if (eClassifier != null)
            {
              EClassifier otherEClassifier = otherEGenericType.getEClassifier();
              if (otherEClassifier != eClassifier)
              {
                String instanceTypeName = eClassifier.getInstanceTypeName();
                String otherInstanceTypeName = otherEClassifier.getInstanceTypeName();
                return instanceTypeName == otherInstanceTypeName && instanceTypeName != null;
              }
              else
              {
                EList<EGenericType> eTypeArguments = eGenericType.getETypeArguments();
                int eTypeArgumentSize = eTypeArguments.size();
                EList<EGenericType> otherETypeArguments = otherEGenericType.getETypeArguments();
                if (eTypeArgumentSize == otherETypeArguments.size())
                {
                  for (int j = 0; j < eTypeArgumentSize; ++j)
                  {
                    EGenericType eTypeArgument = eTypeArguments.get(j);
                    EGenericType otherETypeArgument = otherETypeArguments.get(j);
                    if (!equivalent(eTypeArgument, otherETypeArgument))
                    {
                      return false;
                    }
                  }
                }
                return true;
              }
            }
            else
            {
              ETypeParameter eTypeParameter = eGenericType.getETypeParameter();
              ETypeParameter otherETypeParameter = otherEGenericType.getETypeParameter();
              return eTypeParameter == otherETypeParameter;
            }
          }
        }
        public EGenericType resolve(EGenericType eGenericType)
        {
          ETypeParameter eTypeParameter = eGenericType.getETypeParameter();
          if (eTypeParameter != null)
          {
            EObject eContainer = eTypeParameter.eContainer();
            EGenericType [] eGenericTypes  = (EGenericType[])data;
            for (int i = 0; i < size; ++i)
            {
              EGenericType otherEGenericType = eGenericTypes[i];
              if (otherEGenericType.getEClassifier() == eContainer)
              {
                EList<EGenericType> eTypeArguments = otherEGenericType.getETypeArguments();
                int index = ((List<?>)eContainer.eGet(eTypeParameter.eContainmentFeature())).indexOf(eTypeParameter);
                if (index < eTypeArguments.size())
                {
                  return resolve(eTypeArguments.get(index));
                }
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

            return listIterator();
          }

          protected EGenericType wrap(EClass eClass)
          {
            EGenericType eGenericType = EcoreFactory.eINSTANCE.createEGenericType();
            eGenericType.setEClassifier(eClass);
            return eGenericType;
          }

          protected EClass unwrap(EGenericType eGenericType)
          {
            EClassifier result = ((EGenericTypeImpl)eGenericType).basicGetERawType();
            if (result instanceof EClass)
            {
              return (EClass)result;
            }
            else
            {
              return EcorePackage.Literals.EOBJECT;
            }
          }

          @Override
          protected void delegateAdd(int index, EClass eClass)
          {
            getEGenericSuperTypes().add(index, wrap(eClass));
          }

          @Override
          protected void delegateClear()
          {
            getEGenericSuperTypes().clear();
          }

          @Override
          protected void delegateAdd(EClass eClass)
          {
            getEGenericSuperTypes().add(wrap(eClass));
          }

          @Override
          protected boolean delegateContains(Object object)
          {
            for (EClass eClass : this)
            {
              if (object == eClass)
              {
                return true;
              }
            }
            return false;
          }

          @Override
          protected boolean delegateContainsAll(Collection<?> collection)
          {
            for (Object object : collection)
            {
              if (!delegateContains(object))
              {
                return false;
              }
            }
            return true;
          }

          @Override
          protected boolean delegateEquals(Object object)
          {
            if (object instanceof List<?>)
            {
              List<?> list = (List<?>)object;
              if (list.size() == delegateSize())
              {
                for (Iterator<?> i = list.iterator(), j = iterator(); i.hasNext(); )
                {
                  if (i.next() != j.next())
                  {
                    return false;
                  }
                }
                return true;
              }
            }
            return false;
          }

          @Override
          protected EClass delegateGet(int index)
          {
            EGenericType eGenericType = getEGenericSuperTypes().get(index);
            return unwrap(eGenericType);
          }

          @Override
          protected int delegateHashCode()
          {
            int hashCode = 1;
            for (EGenericType eGenericType : getEGenericSuperTypes())
            {
              Object object = unwrap(eGenericType);
              hashCode = 31 * hashCode + (object == null ? 0 : object.hashCode());
            }
            return hashCode;
          }

          @Override
          protected int delegateIndexOf(Object object)
          {
            int index = 0;
            for (EGenericType eGenericType : getEGenericSuperTypes())
            {
              if (object == unwrap(eGenericType))
              {
                return index;
              }
              ++index;
            }
            return -1;
          }

          @Override
          protected boolean delegateIsEmpty()
          {
            return getEGenericSuperTypes().isEmpty();
          }

          @Override
          protected int delegateLastIndexOf(Object object)
          {
            EList<EGenericType> eGenericSuperTypes = getEGenericSuperTypes();
            for (int i = eGenericSuperTypes.size() - 1; i >= 0; --i)
            {
              if (unwrap(eGenericSuperTypes.get(i)) == object)
              {
                return i;
              }
            }
            return -1;
          }

          @Override
          protected EClass delegateRemove(int index)
          {
            EGenericType eGenericType = getEGenericSuperTypes().remove(index);
            return unwrap(eGenericType);
          }

          @Override
          protected EClass delegateSet(int index, EClass eClass)
          {
            EGenericType eGenericType = getEGenericSuperTypes().get(index);
            EClass result = unwrap(eGenericType);

            // If this is just a proxy being resolved...
            //
            if (resolveProxy(result) == eClass)
            {
              // Force the raw type to be resolved so we don't resolve this endlessly.
              //
              eGenericType.getERawType();
            }
            else
            {
              // Update the classifier and hence the raw type as normal.
              //
              eGenericType.setEClassifier(eClass);
            }
            return result;
          }

          @Override
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

        public void eliminateEquivalentDuplicates()
        {
          EGenericType [] eGenericTypes  = (EGenericType[])data;
          for (int i = size - 1; i >= 0; --i)
          {
            EGenericType eGenericType = eGenericTypes[i];
            for (int j = 0; j < i; ++j)
            {
              EGenericType otherEGenericType = eGenericTypes[j];
              if (equivalent(eGenericType, otherEGenericType))
              {
                remove(i);
                break;
              }
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

                EList<EGenericType> otherETypeArguments = otherEGenericType.getETypeArguments();
                if (eTypeArgumentSize == otherETypeArguments.size())
                {
                  for (int j = 0; j < eTypeArgumentSize; ++j)
                  {
                    EGenericType eTypeArgument = eTypeArguments.get(j);
                    EGenericType otherETypeArgument = otherETypeArguments.get(j);
                    if (!equivalent(eTypeArgument, otherETypeArgument))
                    {
                      return false;
                    }
                  }
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

          {
            EObject eContainer = eTypeParameter.eContainer();
            EGenericType [] eGenericTypes  = (EGenericType[])data;
            for (int i = 0; i < size; ++i)
            {
              EGenericType otherEGenericType = eGenericTypes[i];
              if (otherEGenericType.getEClassifier() == eContainer)
              {
                EList<EGenericType> eTypeArguments = otherEGenericType.getETypeArguments();
                int index = ((List<?>)eContainer.eGet(eTypeParameter.eContainmentFeature())).indexOf(eTypeParameter);
                if (index < eTypeArguments.size())
                {
                  return resolve(eTypeArguments.get(index));
                }
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetEUpperBound(EGenericType newEUpperBound, NotificationChain msgs)
  {
    EGenericType oldEUpperBound = eUpperBound;
    eUpperBound = newEUpperBound;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__EUPPER_BOUND, oldEUpperBound, newEUpperBound);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetELowerBound(EGenericType newELowerBound, NotificationChain msgs)
  {
    EGenericType oldELowerBound = eLowerBound;
    eLowerBound = newELowerBound;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ELOWER_BOUND, oldELowerBound, newELowerBound);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.