/**
* generated by Xtext 2.16.0
*/
package hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.Command;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript;
import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.Import;
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;
/**
*
* An implementation of the model object 'Configuration Script'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.ConfigurationScriptImpl#getImports Imports}
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.ConfigurationScriptImpl#getCommands Commands}
*
*
* @generated
*/
public class ConfigurationScriptImpl extends MinimalEObjectImpl.Container implements ConfigurationScript
{
/**
* The cached value of the '{@link #getImports() Imports}' containment reference list.
*
*
* @see #getImports()
* @generated
* @ordered
*/
protected EList imports;
/**
* The cached value of the '{@link #getCommands() Commands}' containment reference list.
*
*
* @see #getCommands()
* @generated
* @ordered
*/
protected EList commands;
/**
*
*
* @generated
*/
protected ConfigurationScriptImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ApplicationConfigurationPackage.Literals.CONFIGURATION_SCRIPT;
}
/**
*
*
* @generated
*/
@Override
public EList getImports()
{
if (imports == null)
{
imports = new EObjectContainmentEList(Import.class, this, ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__IMPORTS);
}
return imports;
}
/**
*
*
* @generated
*/
@Override
public EList getCommands()
{
if (commands == null)
{
commands = new EObjectContainmentEList(Command.class, this, ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__COMMANDS);
}
return commands;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__IMPORTS:
return ((InternalEList>)getImports()).basicRemove(otherEnd, msgs);
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__COMMANDS:
return ((InternalEList>)getCommands()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__IMPORTS:
return getImports();
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__COMMANDS:
return getCommands();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__IMPORTS:
getImports().clear();
getImports().addAll((Collection extends Import>)newValue);
return;
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__COMMANDS:
getCommands().clear();
getCommands().addAll((Collection extends Command>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__IMPORTS:
getImports().clear();
return;
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__COMMANDS:
getCommands().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__IMPORTS:
return imports != null && !imports.isEmpty();
case ApplicationConfigurationPackage.CONFIGURATION_SCRIPT__COMMANDS:
return commands != null && !commands.isEmpty();
}
return super.eIsSet(featureID);
}
} //ConfigurationScriptImpl