/** */ package activitydiagram.impl; import activitydiagram.*; 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 ActivitydiagramFactoryImpl extends EFactoryImpl implements ActivitydiagramFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ActivitydiagramFactory init() { try { ActivitydiagramFactory theActivitydiagramFactory = (ActivitydiagramFactory)EPackage.Registry.INSTANCE.getEFactory(ActivitydiagramPackage.eNS_URI); if (theActivitydiagramFactory != null) { return theActivitydiagramFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new ActivitydiagramFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ActivitydiagramFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case ActivitydiagramPackage.ACTIVITY: return createActivity(); case ActivitydiagramPackage.CONTROL_FLOW: return createControlFlow(); case ActivitydiagramPackage.OPAQUE_ACTION: return createOpaqueAction(); case ActivitydiagramPackage.INITIAL_NODE: return createInitialNode(); case ActivitydiagramPackage.ACTIVITY_FINAL_NODE: return createActivityFinalNode(); case ActivitydiagramPackage.FORK_NODE: return createForkNode(); case ActivitydiagramPackage.JOIN_NODE: return createJoinNode(); case ActivitydiagramPackage.MERGE_NODE: return createMergeNode(); case ActivitydiagramPackage.DECISION_NODE: return createDecisionNode(); case ActivitydiagramPackage.INTEGER_VARIABLE: return createIntegerVariable(); case ActivitydiagramPackage.BOOLEAN_VARIABLE: return createBooleanVariable(); case ActivitydiagramPackage.BOOLEAN_VALUE: return createBooleanValue(); case ActivitydiagramPackage.INTEGER_VALUE: return createIntegerValue(); case ActivitydiagramPackage.INTEGER_CALCULATION_EXPRESSION: return createIntegerCalculationExpression(); case ActivitydiagramPackage.INTEGER_COMPARISON_EXPRESSION: return createIntegerComparisonExpression(); case ActivitydiagramPackage.BOOLEAN_UNARY_EXPRESSION: return createBooleanUnaryExpression(); case ActivitydiagramPackage.BOOLEAN_BINARY_EXPRESSION: return createBooleanBinaryExpression(); case ActivitydiagramPackage.INPUT_VALUE: return createInputValue(); case ActivitydiagramPackage.INPUT: return createInput(); 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 ActivitydiagramPackage.INTEGER_CALCULATION_OPERATOR: return createIntegerCalculationOperatorFromString(eDataType, initialValue); case ActivitydiagramPackage.INTEGER_COMPARISON_OPERATOR: return createIntegerComparisonOperatorFromString(eDataType, initialValue); case ActivitydiagramPackage.BOOLEAN_UNARY_OPERATOR: return createBooleanUnaryOperatorFromString(eDataType, initialValue); case ActivitydiagramPackage.BOOLEAN_BINARY_OPERATOR: return createBooleanBinaryOperatorFromString(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 ActivitydiagramPackage.INTEGER_CALCULATION_OPERATOR: return convertIntegerCalculationOperatorToString(eDataType, instanceValue); case ActivitydiagramPackage.INTEGER_COMPARISON_OPERATOR: return convertIntegerComparisonOperatorToString(eDataType, instanceValue); case ActivitydiagramPackage.BOOLEAN_UNARY_OPERATOR: return convertBooleanUnaryOperatorToString(eDataType, instanceValue); case ActivitydiagramPackage.BOOLEAN_BINARY_OPERATOR: return convertBooleanBinaryOperatorToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Activity createActivity() { ActivityImpl activity = new ActivityImpl(); return activity; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ControlFlow createControlFlow() { ControlFlowImpl controlFlow = new ControlFlowImpl(); return controlFlow; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public OpaqueAction createOpaqueAction() { OpaqueActionImpl opaqueAction = new OpaqueActionImpl(); return opaqueAction; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public InitialNode createInitialNode() { InitialNodeImpl initialNode = new InitialNodeImpl(); return initialNode; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ActivityFinalNode createActivityFinalNode() { ActivityFinalNodeImpl activityFinalNode = new ActivityFinalNodeImpl(); return activityFinalNode; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ForkNode createForkNode() { ForkNodeImpl forkNode = new ForkNodeImpl(); return forkNode; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JoinNode createJoinNode() { JoinNodeImpl joinNode = new JoinNodeImpl(); return joinNode; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public MergeNode createMergeNode() { MergeNodeImpl mergeNode = new MergeNodeImpl(); return mergeNode; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DecisionNode createDecisionNode() { DecisionNodeImpl decisionNode = new DecisionNodeImpl(); return decisionNode; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerVariable createIntegerVariable() { IntegerVariableImpl integerVariable = new IntegerVariableImpl(); return integerVariable; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BooleanVariable createBooleanVariable() { BooleanVariableImpl booleanVariable = new BooleanVariableImpl(); return booleanVariable; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BooleanValue createBooleanValue() { BooleanValueImpl booleanValue = new BooleanValueImpl(); return booleanValue; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerValue createIntegerValue() { IntegerValueImpl integerValue = new IntegerValueImpl(); return integerValue; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerCalculationExpression createIntegerCalculationExpression() { IntegerCalculationExpressionImpl integerCalculationExpression = new IntegerCalculationExpressionImpl(); return integerCalculationExpression; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerComparisonExpression createIntegerComparisonExpression() { IntegerComparisonExpressionImpl integerComparisonExpression = new IntegerComparisonExpressionImpl(); return integerComparisonExpression; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BooleanUnaryExpression createBooleanUnaryExpression() { BooleanUnaryExpressionImpl booleanUnaryExpression = new BooleanUnaryExpressionImpl(); return booleanUnaryExpression; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BooleanBinaryExpression createBooleanBinaryExpression() { BooleanBinaryExpressionImpl booleanBinaryExpression = new BooleanBinaryExpressionImpl(); return booleanBinaryExpression; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public InputValue createInputValue() { InputValueImpl inputValue = new InputValueImpl(); return inputValue; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Input createInput() { InputImpl input = new InputImpl(); return input; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerCalculationOperator createIntegerCalculationOperatorFromString(EDataType eDataType, String initialValue) { IntegerCalculationOperator result = IntegerCalculationOperator.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 convertIntegerCalculationOperatorToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerComparisonOperator createIntegerComparisonOperatorFromString(EDataType eDataType, String initialValue) { IntegerComparisonOperator result = IntegerComparisonOperator.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 convertIntegerComparisonOperatorToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BooleanUnaryOperator createBooleanUnaryOperatorFromString(EDataType eDataType, String initialValue) { BooleanUnaryOperator result = BooleanUnaryOperator.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 convertBooleanUnaryOperatorToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BooleanBinaryOperator createBooleanBinaryOperatorFromString(EDataType eDataType, String initialValue) { BooleanBinaryOperator result = BooleanBinaryOperator.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 convertBooleanBinaryOperatorToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ActivitydiagramPackage getActivitydiagramPackage() { return (ActivitydiagramPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static ActivitydiagramPackage getPackage() { return ActivitydiagramPackage.eINSTANCE; } } //ActivitydiagramFactoryImpl