/**
*/
package de.sebastianbenz.xgherkin.gherkin.impl;
import de.sebastianbenz.xgherkin.gherkin.ExampleCell;
import de.sebastianbenz.xgherkin.gherkin.ExampleRow;
import de.sebastianbenz.xgherkin.gherkin.GherkinPackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Example Row</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link de.sebastianbenz.xgherkin.gherkin.impl.ExampleRowImpl#getCells <em>Cells</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ExampleRowImpl extends MinimalEObjectImpl.Container implements ExampleRow
{
/**
* The cached value of the '{@link #getCells() <em>Cells</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCells()
* @generated
* @ordered
*/
protected EList<ExampleCell> cells;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ExampleRowImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GherkinPackage.Literals.EXAMPLE_ROW;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ExampleCell> getCells()
{
if (cells == null)
{
cells = new EObjectContainmentEList<ExampleCell>(ExampleCell.class, this, GherkinPackage.EXAMPLE_ROW__CELLS);
}
return cells;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GherkinPackage.EXAMPLE_ROW__CELLS:
return ((InternalEList<?>)getCells()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case GherkinPackage.EXAMPLE_ROW__CELLS:
return getCells();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case GherkinPackage.EXAMPLE_ROW__CELLS:
getCells().clear();
getCells().addAll((Collection<? extends ExampleCell>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GherkinPackage.EXAMPLE_ROW__CELLS:
getCells().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GherkinPackage.EXAMPLE_ROW__CELLS:
return cells != null && !cells.isEmpty();
}
return super.eIsSet(featureID);
}
} //ExampleRowImpl