| /** |
| */ |
| package laxcondition.impl; |
| |
| import laxcondition.*; |
| |
| 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 LaxconditionFactoryImpl extends EFactoryImpl implements LaxconditionFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static LaxconditionFactory init() { |
| try { |
| LaxconditionFactory theLaxconditionFactory = (LaxconditionFactory)EPackage.Registry.INSTANCE.getEFactory(LaxconditionPackage.eNS_URI); |
| if (theLaxconditionFactory != null) { |
| return theLaxconditionFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new LaxconditionFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LaxconditionFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case LaxconditionPackage.CONDITION: return createCondition(); |
| case LaxconditionPackage.QUANTIFIED_LAX_CONDITION: return createQuantifiedLaxCondition(); |
| case LaxconditionPackage.TRUE: return createTrue(); |
| case LaxconditionPackage.FORMULA: return createFormula(); |
| case LaxconditionPackage.VARIABLE: return createVariable(); |
| 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 LaxconditionPackage.QUANTIFIER: |
| return createQuantifierFromString(eDataType, initialValue); |
| case LaxconditionPackage.OPERATOR: |
| return createOperatorFromString(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 LaxconditionPackage.QUANTIFIER: |
| return convertQuantifierToString(eDataType, instanceValue); |
| case LaxconditionPackage.OPERATOR: |
| return convertOperatorToString(eDataType, instanceValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Condition createCondition() { |
| ConditionImpl condition = new ConditionImpl(); |
| return condition; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public QuantifiedLaxCondition createQuantifiedLaxCondition() { |
| QuantifiedLaxConditionImpl quantifiedLaxCondition = new QuantifiedLaxConditionImpl(); |
| return quantifiedLaxCondition; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public True createTrue() { |
| TrueImpl true_ = new TrueImpl(); |
| return true_; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Formula createFormula() { |
| FormulaImpl formula = new FormulaImpl(); |
| return formula; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Variable createVariable() { |
| VariableImpl variable = new VariableImpl(); |
| return variable; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Quantifier createQuantifierFromString(EDataType eDataType, String initialValue) { |
| Quantifier result = Quantifier.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 convertQuantifierToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Operator createOperatorFromString(EDataType eDataType, String initialValue) { |
| Operator result = Operator.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 convertOperatorToString(EDataType eDataType, Object instanceValue) { |
| return instanceValue == null ? null : instanceValue.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LaxconditionPackage getLaxconditionPackage() { |
| return (LaxconditionPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static LaxconditionPackage getPackage() { |
| return LaxconditionPackage.eINSTANCE; |
| } |
| |
| } //LaxconditionFactoryImpl |