Java Code Examples for org.eclipse.emf.ecore.EClass#getESuperTypes()

The following examples show how to use org.eclipse.emf.ecore.EClass#getESuperTypes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataSwitch.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch( EClass theEClass, EObject theEObject )
{
	if ( theEClass.eContainer( ) == modelPackage )
	{
		return doSwitch( theEClass.getClassifierID( ), theEObject );
	}
	else
	{
		List<EClass> eSuperTypes = theEClass.getESuperTypes( );
		return eSuperTypes.isEmpty( ) ? defaultCase( theEObject )
				: doSwitch( eSuperTypes.get( 0 ), theEObject );
	}
}
 
Example 2
Source File: ValidscopingtestSwitch.java    From dsl-devkit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 3
Source File: GenericTestSwitch.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T1 doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 4
Source File: jpdl32Switch.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 5
Source File: LayoutSwitch.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch( EClass theEClass, EObject theEObject )
{
	if ( theEClass.eContainer( ) == modelPackage )
	{
		return doSwitch( theEClass.getClassifierID( ), theEObject );
	}
	else
	{
		List<EClass> eSuperTypes = theEClass.getESuperTypes( );
		return eSuperTypes.isEmpty( ) ? defaultCase( theEObject )
				: doSwitch( eSuperTypes.get( 0 ), theEObject );
	}
}
 
Example 6
Source File: DcSwitch.java    From fixflow with Apache License 2.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
    if (theEClass.eContainer() == modelPackage) {
        return doSwitch(theEClass.getClassifierID(), theEObject);
    } else {
        List<EClass> eSuperTypes = theEClass.getESuperTypes();
        return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0),
                theEObject);
    }
}
 
Example 7
Source File: IfcModel.java    From BIMserver with GNU Affero General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private void buildIndexWithSuperTypes(IdEObject eObject, EClass eClass) {
	if (!indexPerClassWithSubTypes.containsKey(eClass)) {
		indexPerClassWithSubTypes.put(eClass, new ArrayList<IdEObject>());
	}
	((List<IdEObject>) indexPerClassWithSubTypes.get(eClass)).add(eObject);
	for (EClass superClass : eClass.getESuperTypes()) {
		buildIndexWithSuperTypes(eObject, superClass);
	}
}
 
Example 8
Source File: RadarTypeSwitch.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns
 * a non null result; it yields that result. <!-- begin-user-doc --> <!--
 * end-user-doc -->
 * 
 * @return the first non-null result returned by a <code>caseXXX</code>
 *         call.
 * @generated
 */
protected T doSwitch( EClass theEClass, EObject theEObject )
{
	if ( theEClass.eContainer( ) == modelPackage )
	{
		return doSwitch( theEClass.getClassifierID( ), theEObject );
	}
	else
	{
		List<EClass> eSuperTypes = theEClass.getESuperTypes( );
		return eSuperTypes.isEmpty( ) ? defaultCase( theEObject )
				: doSwitch( eSuperTypes.get( 0 ), theEObject );
	}
}
 
Example 9
Source File: ComponentSwitch.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch( EClass theEClass, EObject theEObject )
{
	if ( theEClass.eContainer( ) == modelPackage )
	{
		return doSwitch( theEClass.getClassifierID( ), theEObject );
	}
	else
	{
		List<EClass> eSuperTypes = theEClass.getESuperTypes( );
		return eSuperTypes.isEmpty( ) ? defaultCase( theEObject )
				: doSwitch( eSuperTypes.get( 0 ), theEObject );
	}
}
 
Example 10
Source File: BusinessModelSwitch.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 11
Source File: PhysicalModelSwitch.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 12
Source File: OlapModelSwitch.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 13
Source File: BusinessModelSwitch.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 14
Source File: AnalyticalModelSwitch.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 15
Source File: ServicesSwitch.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
    if (theEClass.eContainer() == modelPackage) {
        return doSwitch(theEClass.getClassifierID(), theEObject);
    }
    else {
        List<EClass> eSuperTypes = theEClass.getESuperTypes();
        return
            eSuperTypes.isEmpty() ?
                defaultCase(theEObject) :
                doSwitch(eSuperTypes.get(0), theEObject);
    }
}
 
Example 16
Source File: BpmnDiSwitch.java    From fixflow with Apache License 2.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
    if (theEClass.eContainer() == modelPackage) {
        return doSwitch(theEClass.getClassifierID(), theEObject);
    } else {
        List<EClass> eSuperTypes = theEClass.getESuperTypes();
        return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0),
                theEObject);
    }
}
 
Example 17
Source File: PhysicalModelSwitch.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 18
Source File: OlapModelSwitch.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @return the first non-null result returned by a <code>caseXXX</code> call.
 * @generated
 */
protected T doSwitch(EClass theEClass, EObject theEObject) {
	if (theEClass.eContainer() == modelPackage) {
		return doSwitch(theEClass.getClassifierID(), theEObject);
	}
	else {
		List<EClass> eSuperTypes = theEClass.getESuperTypes();
		return
			eSuperTypes.isEmpty() ?
				defaultCase(theEObject) :
				doSwitch(eSuperTypes.get(0), theEObject);
	}
}
 
Example 19
Source File: GamlSemanticHighlightingCalculator.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
void process(final EObject object, final EClass clazz) {
	final int id = clazz.getClassifierID();

	switch (id) {
		case GamlPackage.PRAGMA:
			setStyle(object, PRAGMA_ID, ((Pragma) object).getName(), false);
			break;
		case GamlPackage.SASSIGNMENT:
			final String s = ((S_Assignment) object).getKey();
			setStyle(object, ASSIGN_ID, s, false);
			break;
		case GamlPackage.FACET:
			final Facet f = (Facet) object;
			final String key = f.getKey();
			if (ASSIGNMENTS.contains(key)) {
				setStyle(object, ASSIGN_ID, 0);
			} else {
				setStyle(object, FACET_ID, 0);
				if (key.startsWith("type")) {
					setStyle(TYPE_ID, NodeModelUtils.getNode(f.getExpr()));
				} else if (f.getName() != null) {
					setStyle(object, VARDEF_ID, 1);
				}
			}
			break;
		case GamlPackage.TERMINAL_EXPRESSION:
			if (!(object instanceof StringLiteral)) {
				setStyle(object, NUMBER_ID, 0);
			}
			break;
		case GamlPackage.RESERVED_LITERAL:
			setStyle(object, RESERVED_ID, 0);
			break;
		case GamlPackage.BINARY_OPERATOR:
		case GamlPackage.FUNCTION:
			setStyle(object, OPERATOR_ID, EGaml.getInstance().getKeyOf(object), true);
			break;
		case GamlPackage.ARGUMENT_PAIR:
			setStyle(object, VARIABLE_ID, ((ArgumentPair) object).getOp(), false);
			break;
		case GamlPackage.VARIABLE_REF:
			setStyle(VARIABLE_ID, NodeModelUtils.getNode(object));
			break;
		case GamlPackage.UNIT_NAME:
			setStyle(object, UNIT_ID, 0);
			break;
		case GamlPackage.TYPE_REF:
			final Statement st = EGaml.getInstance().getStatement(object);
			if (st instanceof S_Definition && ((S_Definition) st).getTkey() == object) {
				setStyle(KEYWORD_ID, NodeModelUtils.findActualNodeFor(object));
			} else {
				setStyle(TYPE_ID, NodeModelUtils.getNode(object));
			}
			break;
		case GamlPackage.PARAMETER:
			setStyle(object, VARIABLE_ID, ((Parameter) object).getBuiltInFacetKey(), false);
			break;
		case GamlPackage.ARGUMENT_DEFINITION:
			setStyle(object, VARDEF_ID, ((ArgumentDefinition) object).getName(), false);
			break;
		case GamlPackage.STATEMENT:
			final Statement stat = (Statement) object;
			setStyle(object, VARDEF_ID, EGaml.getInstance().getNameOf(stat), false);
			setStyle(object, KEYWORD_ID, stat.getKey(), false);
			break;
		default:
			final List<EClass> eSuperTypes = clazz.getESuperTypes();
			if (!eSuperTypes.isEmpty()) {
				process(object, eSuperTypes.get(0));
			}
	}
}
 
Example 20
Source File: EClassComparator.java    From dsl-devkit with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Adds an EClass and all its super types to the graph.
 *
 * @param graph
 *          destination graph
 * @param type
 *          type to add
 */
private static void addType(final Graph<EClass> graph, final EClass type) {
  graph.addNode(type);
  for (EClass superType : type.getESuperTypes()) {
    addType(graph, superType);
    graph.addEdge(type, superType);
  }
}