/**
 */
package de.ugoe.cs.swe.bnftools.ebnf.impl;

import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage;
import de.ugoe.cs.swe.bnftools.ebnf.SectionHeading;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Section Heading</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.SectionHeadingImpl#getSectionHeader <em>Section Header</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SectionHeadingImpl extends MinimalEObjectImpl.Container implements SectionHeading
{
  /**
   * The default value of the '{@link #getSectionHeader() <em>Section Header</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSectionHeader()
   * @generated
   * @ordered
   */
  protected static final String SECTION_HEADER_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getSectionHeader() <em>Section Header</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSectionHeader()
   * @generated
   * @ordered
   */
  protected String sectionHeader = SECTION_HEADER_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected SectionHeadingImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return EbnfPackage.Literals.SECTION_HEADING;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getSectionHeader()
  {
    return sectionHeader;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSectionHeader(String newSectionHeader)
  {
    String oldSectionHeader = sectionHeader;
    sectionHeader = newSectionHeader;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.SECTION_HEADING__SECTION_HEADER, oldSectionHeader, sectionHeader));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case EbnfPackage.SECTION_HEADING__SECTION_HEADER:
        return getSectionHeader();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case EbnfPackage.SECTION_HEADING__SECTION_HEADER:
        setSectionHeader((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case EbnfPackage.SECTION_HEADING__SECTION_HEADER:
        setSectionHeader(SECTION_HEADER_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case EbnfPackage.SECTION_HEADING__SECTION_HEADER:
        return SECTION_HEADER_EDEFAULT == null ? sectionHeader != null : !SECTION_HEADER_EDEFAULT.equals(sectionHeader);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (sectionHeader: ");
    result.append(sectionHeader);
    result.append(')');
    return result.toString();
  }

} //SectionHeadingImpl
