Examples of EGenericType


Examples of org.eclipse.emf.ecore.EGenericType

                "get", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
        addEParameter(op, ecorePackage.getEString(), "styleId", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$

        op = addEOperation(styleBlackboardEClass, ecorePackage.getEJavaObject(),
                "lookup", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
        EGenericType g1 = createEGenericType(ecorePackage.getEJavaClass());
        EGenericType g2 = createEGenericType();
        g1.getETypeArguments().add(g2);
        addEParameter(op, g1, "theClass", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$

        op = addEOperation(styleBlackboardEClass, ecorePackage.getEBoolean(),
                "contains", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

        initEReference(
                getViewportModel_RenderManagerInternal(),
                this.getRenderManager(),
                this.getRenderManager_ViewportModelInternal(),
                "renderManagerInternal", null, 0, 1, ViewportModel.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
        EGenericType g1 = createEGenericType(this.getSortedSet());
        EGenericType g2 = createEGenericType(ecorePackage.getEDoubleObject());
        g1.getETypeArguments().add(g2);
        initEAttribute(
                getViewportModel_PreferredScaleDenominators(),
                g1,
                "preferredScaleDenominators", null, 0, 1, ViewportModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.emf.ecore.EGenericType

        EOperation op = addEOperation(planeEClass, ecorePackage.getEBoolean(),
                "plane_element_type", 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

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

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

            return listIterator();
          }

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

          protected EClassifier unwrap(EGenericType eGenericType)
          {
            EClassifier result = ((EGenericTypeImpl)eGenericType).basicGetERawType();
            if (result  != null)
            {
              return result;
            }
            else
            {
              return EcorePackage.Literals.EJAVA_OBJECT;
            }
          }

          @Override
          protected void delegateAdd(int index, EClassifier eClassifier)
          {
            getEGenericExceptions().add(index, wrap(eClassifier));
          }

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

          @Override
          protected void delegateAdd(EClassifier eClassifier)
          {
            getEGenericExceptions().add(wrap(eClassifier));
          }

          @Override
          protected boolean delegateContains(Object object)
          {
            for (EClassifier eClassifier : this)
            {
              if (object == eClassifier)
              {
                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 EClassifier delegateGet(int index)
          {
            EGenericType eGenericType = getEGenericExceptions().get(index);
            return unwrap(eGenericType);
          }

          @Override
          protected int delegateHashCode()
          {
            int hashCode = 1;
            for (EGenericType eGenericType : getEGenericExceptions())
            {
              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 : getEGenericExceptions())
            {
              if (object == unwrap(eGenericType))
              {
                return index;
              }
              ++index;
            }
            return -1;
          }

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

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

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

          @Override
          protected EClassifier delegateSet(int index, EClassifier eClassifier)
          {
            EGenericType eGenericType = getEGenericExceptions().get(index);
            EClassifier result = unwrap(eGenericType);

            // If this is just a proxy being resolved...
            //
            if (resolveProxy(result) == eClassifier)
            {
              // 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(eClassifier);
            }
            return result;
          }

          @Override
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
                   (EOperationImpl.this,
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)
              {
                if (otherEClassifier == null)
                {
                  return false;
                }
                else
                {
                  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
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.