All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.ocl.utilities.util.UtilitiesSwitch Maven / Gradle / Ivy

/**
 * 
 *
 * Copyright (c) 2006, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   IBM - Initial API and implementation
 * 
 * 
 *
 * $Id: UtilitiesSwitch.java,v 1.9 2010/04/08 06:26:42 ewillink Exp $
 * /
 *
 * 
 *
 * $Id: UtilitiesSwitch.java,v 1.9 2010/04/08 06:26:42 ewillink Exp $
 */
package org.eclipse.ocl.utilities.util;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.ocl.utilities.ASTNode;
import org.eclipse.ocl.utilities.CallingASTNode;
import org.eclipse.ocl.utilities.ExpressionInOCL;
import org.eclipse.ocl.utilities.PredefinedType;
import org.eclipse.ocl.utilities.TypedASTNode;
import org.eclipse.ocl.utilities.TypedElement;
import org.eclipse.ocl.utilities.UtilitiesPackage;
import org.eclipse.ocl.utilities.Visitable;
import org.eclipse.ocl.utilities.Visitor;

/**
 * 
 * The Switch for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the caseXXX method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * 
 * @see org.eclipse.ocl.utilities.UtilitiesPackage
 * @generated
 */
public class UtilitiesSwitch
		extends Switch {

	/**
	 * The cached model package
	 * 
	 * 
	 * @generated
	 */
	protected static UtilitiesPackage modelPackage;

	/**
	 * Creates an instance of the switch.
	 * 
	 * 
	 * @generated
	 */
	public UtilitiesSwitch() {
		if (modelPackage == null) {
			modelPackage = UtilitiesPackage.eINSTANCE;
		}
	}

	/**
	 * Checks whether this is a switch for the given package.
	 * 
	 * 
	 * @parameter ePackage the package in question.
	 * @return whether this is a switch for the given package.
	 * @generated
	 */
	@Override
	protected boolean isSwitchFor(EPackage ePackage) {
		return ePackage == modelPackage;
	}

	/**
	 * Calls caseXXX for each class of the model until one returns a non null result; it yields that result.
	 * 
	 * 
	 * @return the first non-null result returned by a caseXXX call.
	 * @generated
	 */
	@Override
	protected T1 doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case UtilitiesPackage.AST_NODE : {
				ASTNode astNode = (ASTNode) theEObject;
				T1 result = caseASTNode(astNode);
				if (result == null)
					result = defaultCase(theEObject);
				return result;
			}
			case UtilitiesPackage.CALLING_AST_NODE : {
				CallingASTNode callingASTNode = (CallingASTNode) theEObject;
				T1 result = caseCallingASTNode(callingASTNode);
				if (result == null)
					result = caseASTNode(callingASTNode);
				if (result == null)
					result = defaultCase(theEObject);
				return result;
			}
			case UtilitiesPackage.TYPED_AST_NODE : {
				TypedASTNode typedASTNode = (TypedASTNode) theEObject;
				T1 result = caseTypedASTNode(typedASTNode);
				if (result == null)
					result = caseASTNode(typedASTNode);
				if (result == null)
					result = defaultCase(theEObject);
				return result;
			}
			case UtilitiesPackage.VISITABLE : {
				Visitable visitable = (Visitable) theEObject;
				T1 result = caseVisitable(visitable);
				if (result == null)
					result = defaultCase(theEObject);
				return result;
			}
			case UtilitiesPackage.VISITOR : {
				Visitor visitor = (Visitor) theEObject;
				T1 result = caseVisitor(visitor);
				if (result == null)
					result = defaultCase(theEObject);
				return result;
			}
			case UtilitiesPackage.TYPED_ELEMENT : {
				TypedElement typedElement = (TypedElement) theEObject;
				T1 result = caseTypedElement(typedElement);
				if (result == null)
					result = defaultCase(theEObject);
				return result;
			}
			case UtilitiesPackage.EXPRESSION_IN_OCL : {
				ExpressionInOCL expressionInOCL = (ExpressionInOCL) theEObject;
				T1 result = caseExpressionInOCL(expressionInOCL);
				if (result == null)
					result = caseVisitable(expressionInOCL);
				if (result == null)
					result = defaultCase(theEObject);
				return result;
			}
			case UtilitiesPackage.PREDEFINED_TYPE : {
				PredefinedType predefinedType = (PredefinedType) theEObject;
				T1 result = casePredefinedType(predefinedType);
				if (result == null)
					result = defaultCase(theEObject);
				return result;
			}
			default :
				return defaultCase(theEObject);
		}
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'AST Node'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'AST Node'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T1 caseASTNode(ASTNode object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Calling AST Node'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Calling AST Node'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T1 caseCallingASTNode(CallingASTNode object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Predefined Type'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Predefined Type'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public  T1 casePredefinedType(PredefinedType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Typed AST Node'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Typed AST Node'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T1 caseTypedASTNode(TypedASTNode object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Visitable'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Visitable'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T1 caseVisitable(Visitable object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Typed Element'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Typed Element'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public  T1 caseTypedElement(TypedElement object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Visitor'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Visitor'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public  T1 caseVisitor(
			Visitor object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Expression In OCL'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Expression In OCL'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public  T1 caseExpressionInOCL(ExpressionInOCL object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'EObject'.
	 * 
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
	 * 
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'EObject'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
	 * @generated
	 */
	@Override
	public T1 defaultCase(EObject object) {
		return null;
	}

} //UtilitiesSwitch




© 2015 - 2024 Weber Informatics LLC | Privacy Policy