Examples of EGenericType


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

    op = initEOperation(getEClass__GetOverride__EOperation(), this.getEOperation(), "getOverride", 0, 1, IS_UNIQUE, IS_ORDERED);
    addEParameter(op, this.getEOperation(), "operation", 0, 1, IS_UNIQUE, IS_ORDERED);

    initEClass(eClassifierEClass, EClassifier.class, "EClassifier", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getEClassifier_InstanceClassName(), this.getEString(), "instanceClassName", null, 0, 1, EClassifier.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    EGenericType g1 = createEGenericType(this.getEJavaClass());
    EGenericType g2 = createEGenericType();
    g1.getETypeArguments().add(g2);
    initEAttribute(getEClassifier_InstanceClass(), g1, "instanceClass", null, 0, 1, EClassifier.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
    initEAttribute(getEClassifier_DefaultValue(), this.getEJavaObject(), "defaultValue", null, 0, 1, EClassifier.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
    initEAttribute(getEClassifier_InstanceTypeName(), this.getEString(), "instanceTypeName", null, 0, 1, EClassifier.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getEClassifier_EPackage(), this.getEPackage(), this.getEPackage_EClassifiers(), "ePackage", null, 0, 1, EClassifier.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

        EOperation op = addEOperation(fontEClass, ecorePackage.getEBoolean(), "non_negative_size",
                0, 1, IS_UNIQUE, IS_ORDERED);
        addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE,
                IS_ORDERED);
        EGenericType g1 = createEGenericType(ecorePackage.getEMap());
        EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject());
        g1.getETypeArguments().add(g2);
        g2 = createEGenericType(ecorePackage.getEJavaObject());
        g1.getETypeArguments().add(g2);
        addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED);
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

          result.append(eTypeParameter.getName());
        }
        else
        {
          result.append('?');
          EGenericType eUpperBound = eGenericType.getEUpperBound();
          if (eUpperBound != null)
          {
            result.append(" extends ");
            convertJavaInstanceTypeName(result, eUpperBound);
          }
          else
          {
            EGenericType eLowerBound = eGenericType.getELowerBound();
            if (eLowerBound != null)
            {
              result.append(" super ");
              convertJavaInstanceTypeName(result, eLowerBound);
            }
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

  }

  public void setEType(EClassifier newEType)
  {
    NotificationChain msgs = setEType(newEType, null);
    EGenericType newEGenericType = null;
    if (newEType != null)
    {
      newEGenericType = EcoreFactory.eINSTANCE.createEGenericType();
      newEGenericType.setEClassifier(eType);
    }
    msgs = setEGenericType(newEGenericType, msgs);
    if (msgs != null)
    {
      msgs.dispatch();
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

   * <!-- end-user-doc -->
   * @generated NOT
   */
  public NotificationChain basicSetEGenericType(EGenericType newEGenericType, NotificationChain msgs)
  {
    EGenericType oldEGenericType = eGenericType;
    eGenericType = newEGenericType;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.ETYPED_ELEMENT__EGENERIC_TYPE, oldEGenericType, newEGenericType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

    return eTypeParameter;
  }
 
  protected EGenericType createEGenericType()
  {
    EGenericType eGenericType = ecoreFactory.createEGenericType();
    return eGenericType;
  }
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.