Package SmartGen.util

Source Code of SmartGen.util.SmartGenSwitch

/**
* <copyright>
* </copyright>
*
* $Id$
*/
package SmartGen.util;

import SmartGen.Archive;
import SmartGen.ConfigurableElement;
import SmartGen.Data;
import SmartGen.FieldValue;
import SmartGen.File;
import SmartGen.Folder;
import SmartGen.Option;
import SmartGen.SmartGenPackage;
import SmartGen.StringValue;
import SmartGen.Value;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

/**
* <!-- begin-user-doc -->
* The <b>Switch</b> for the model's inheritance hierarchy.
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
* to invoke the <code>caseXXX</code> 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.
* <!-- end-user-doc -->
* @see SmartGen.SmartGenPackage
* @generated
*/
public class SmartGenSwitch {
  /**
   * The cached model package
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected static SmartGenPackage modelPackage;

  /**
   * Creates an instance of the switch.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SmartGenSwitch() {
    if (modelPackage == null) {
      modelPackage = SmartGenPackage.eINSTANCE;
    }
  }

  /**
   * 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
   */
  public Object doSwitch(EObject theEObject) {
    return doSwitch(theEObject.eClass(), theEObject);
  }

  /**
   * 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 Object doSwitch(EClass theEClass, EObject theEObject) {
    if (theEClass.eContainer() == modelPackage) {
      return doSwitch(theEClass.getClassifierID(), theEObject);
    }
    else {
      List eSuperTypes = theEClass.getESuperTypes();
      return
        eSuperTypes.isEmpty() ?
          defaultCase(theEObject) :
          doSwitch((EClass)eSuperTypes.get(0), theEObject);
    }
  }

  /**
   * 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 Object doSwitch(int classifierID, EObject theEObject) {
    switch (classifierID) {
      case SmartGenPackage.DATA: {
        Data data = (Data)theEObject;
        Object result = caseData(data);
        if (result == null) result = caseValue(data);
        if (result == null) result = caseConfigurableElement(data);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.FIELD_VALUE: {
        FieldValue fieldValue = (FieldValue)theEObject;
        Object result = caseFieldValue(fieldValue);
        if (result == null) result = caseConfigurableElement(fieldValue);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.VALUE: {
        Value value = (Value)theEObject;
        Object result = caseValue(value);
        if (result == null) result = caseConfigurableElement(value);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.STRING_VALUE: {
        StringValue stringValue = (StringValue)theEObject;
        Object result = caseStringValue(stringValue);
        if (result == null) result = caseValue(stringValue);
        if (result == null) result = caseConfigurableElement(stringValue);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.FILE: {
        File file = (File)theEObject;
        Object result = caseFile(file);
        if (result == null) result = caseData(file);
        if (result == null) result = caseValue(file);
        if (result == null) result = caseConfigurableElement(file);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.PACKAGE: {
        SmartGen.Package package_ = (SmartGen.Package)theEObject;
        Object result = casePackage(package_);
        if (result == null) result = caseFile(package_);
        if (result == null) result = caseData(package_);
        if (result == null) result = caseValue(package_);
        if (result == null) result = caseConfigurableElement(package_);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.OPTION: {
        Option option = (Option)theEObject;
        Object result = caseOption(option);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.CONFIGURABLE_ELEMENT: {
        ConfigurableElement configurableElement = (ConfigurableElement)theEObject;
        Object result = caseConfigurableElement(configurableElement);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.FOLDER: {
        Folder folder = (Folder)theEObject;
        Object result = caseFolder(folder);
        if (result == null) result = casePackage(folder);
        if (result == null) result = caseFile(folder);
        if (result == null) result = caseData(folder);
        if (result == null) result = caseValue(folder);
        if (result == null) result = caseConfigurableElement(folder);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.ARCHIVE: {
        Archive archive = (Archive)theEObject;
        Object result = caseArchive(archive);
        if (result == null) result = casePackage(archive);
        if (result == null) result = caseFile(archive);
        if (result == null) result = caseData(archive);
        if (result == null) result = caseValue(archive);
        if (result == null) result = caseConfigurableElement(archive);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
    }
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Data</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Data</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseData(Data object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Field Value</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Field Value</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseFieldValue(FieldValue object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Value</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Value</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseValue(Value object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>String Value</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>String Value</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseStringValue(StringValue object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>File</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>File</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseFile(File object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Package</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Package</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object casePackage(SmartGen.Package object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Option</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Option</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseOption(Option object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Configurable Element</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Configurable Element</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseConfigurableElement(ConfigurableElement object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Folder</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Folder</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseFolder(Folder object) {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Archive</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Archive</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public Object caseArchive(Archive object) {
    return null;
  }

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

} //SmartGenSwitch
TOP

Related Classes of SmartGen.util.SmartGenSwitch

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.