org.nasdanika.models.excel.impl.WorkbookImpl Maven / Gradle / Ivy
/**
*/
package org.nasdanika.models.excel.impl;
import java.lang.reflect.InvocationTargetException;
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.InternalEList;
import org.nasdanika.models.excel.ExcelFactory;
import org.nasdanika.models.excel.ExcelPackage;
import org.nasdanika.models.excel.RowSheet;
import org.nasdanika.models.excel.Sheet;
import org.nasdanika.models.excel.Workbook;
/**
*
* An implementation of the model object 'Workbook'.
*
*
* The following features are implemented:
*
*
* - {@link org.nasdanika.models.excel.impl.WorkbookImpl#getSheets Sheets}
*
*
* @generated
*/
public class WorkbookImpl extends MinimalEObjectImpl.Container implements Workbook {
/**
*
*
* @generated
*/
protected WorkbookImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExcelPackage.Literals.WORKBOOK;
}
/**
*
*
* @generated
*/
@Override
protected int eStaticFeatureCount() {
return 0;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getSheets() {
return (EList)eDynamicGet(ExcelPackage.WORKBOOK__SHEETS, ExcelPackage.Literals.WORKBOOK__SHEETS, true, true);
}
/**
*
*
* @generated NOT
*/
@Override
public RowSheet addRowSheet(String name) {
RowSheet rowSheet = ((ExcelFactory) eClass().getEPackage().getEFactoryInstance()).createRowSheet();
getSheets().add(rowSheet);
rowSheet.setName(name);
return rowSheet;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ExcelPackage.WORKBOOK__SHEETS:
return ((InternalEList>)getSheets()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ExcelPackage.WORKBOOK__SHEETS:
return getSheets();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ExcelPackage.WORKBOOK__SHEETS:
getSheets().clear();
getSheets().addAll((Collection extends Sheet>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ExcelPackage.WORKBOOK__SHEETS:
getSheets().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ExcelPackage.WORKBOOK__SHEETS:
return !getSheets().isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public Object eInvoke(int operationID, EList> arguments) throws InvocationTargetException {
switch (operationID) {
case ExcelPackage.WORKBOOK___ADD_ROW_SHEET__STRING:
return addRowSheet((String)arguments.get(0));
}
return super.eInvoke(operationID, arguments);
}
} //WorkbookImpl