/**
*/
package brokermodel.experimentRuntime.impl;
import brokermodel.experimentRuntime.*;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class ExperimentRuntimeFactoryImpl extends EFactoryImpl implements ExperimentRuntimeFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static ExperimentRuntimeFactory init() {
try {
ExperimentRuntimeFactory theExperimentRuntimeFactory = (ExperimentRuntimeFactory)EPackage.Registry.INSTANCE.getEFactory("http://nam.ece.upatras.gr/broker/model/experimentRuntime");
if (theExperimentRuntimeFactory != null) {
return theExperimentRuntimeFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new ExperimentRuntimeFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExperimentRuntimeFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case ExperimentRuntimePackage.RUNTIME_ELEMENT: return createRuntimeElement();
case ExperimentRuntimePackage.RUNNING_SCENARIOS: return createRunningScenarios();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
case ExperimentRuntimePackage.RUNTIME_ELEMENT_STATUS:
return createRuntimeElementStatusFromString(eDataType, initialValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
case ExperimentRuntimePackage.RUNTIME_ELEMENT_STATUS:
return convertRuntimeElementStatusToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RuntimeElement createRuntimeElement() {
RuntimeElementImpl runtimeElement = new RuntimeElementImpl();
return runtimeElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RunningScenarios createRunningScenarios() {
RunningScenariosImpl runningScenarios = new RunningScenariosImpl();
return runningScenarios;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RuntimeElementStatus createRuntimeElementStatusFromString(EDataType eDataType, String initialValue) {
RuntimeElementStatus result = RuntimeElementStatus.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String convertRuntimeElementStatusToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExperimentRuntimePackage getExperimentRuntimePackage() {
return (ExperimentRuntimePackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static ExperimentRuntimePackage getPackage() {
return ExperimentRuntimePackage.eINSTANCE;
}
} //ExperimentRuntimeFactoryImpl