diff options
Diffstat (limited to 'plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/ArithmeticExpressionImpl.java')
-rw-r--r-- | plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/ArithmeticExpressionImpl.java | 320 |
1 files changed, 320 insertions, 0 deletions
diff --git a/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/ArithmeticExpressionImpl.java b/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/ArithmeticExpressionImpl.java new file mode 100644 index 00000000000..c21753a675e --- /dev/null +++ b/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/ArithmeticExpressionImpl.java @@ -0,0 +1,320 @@ +/** + */ +package org.eclipse.papyrus.uml.alf.impl; + +import java.lang.reflect.InvocationTargetException; +import java.math.BigInteger; +import java.util.Map; +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.DiagnosticChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.WrappedException; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.emf.ecore.util.EObjectValidator; +import org.eclipse.papyrus.uml.alf.AlfPackage; +import org.eclipse.papyrus.uml.alf.ArithmeticExpression; +import org.eclipse.papyrus.uml.alf.ElementReference; +import org.eclipse.papyrus.uml.alf.util.AlfValidator; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Arithmetic Expression</b></em>'. + * <!-- end-user-doc --> + * <p> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.uml.alf.impl.ArithmeticExpressionImpl#isIsConcatenation <em>Is Concatenation</em>}</li> + * </ul> + * + * @generated + */ +public class ArithmeticExpressionImpl extends BinaryExpressionImpl implements ArithmeticExpression { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected ArithmeticExpressionImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AlfPackage.eINSTANCE.getArithmeticExpression(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean isIsConcatenation() { + return (Boolean) eGet(AlfPackage.eINSTANCE.getArithmeticExpression_IsConcatenation(), true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public void setIsConcatenation(boolean newIsConcatenation) { + eSet(AlfPackage.eINSTANCE.getArithmeticExpression_IsConcatenation(), newIsConcatenation); + } + + /** + * The cached invocation delegate for the '{@link #type() <em>Type</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #type() + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate TYPE__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getArithmeticExpression__Type()).getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public ElementReference type() { + try { + return (ElementReference) TYPE__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * The cached invocation delegate for the '{@link #lower() <em>Lower</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #lower() + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate LOWER__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getArithmeticExpression__Lower()).getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public BigInteger lower() { + try { + return (BigInteger) LOWER__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * The cached invocation delegate for the '{@link #upper() <em>Upper</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #upper() + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate UPPER__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getArithmeticExpression__Upper()).getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public BigInteger upper() { + try { + return (BigInteger) UPPER__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean arithmeticExpressionIsConcatenationDerivation(DiagnosticChain diagnostics, Map<Object, Object> context) { + // TODO: implement this method + // -> specify the condition that violates the invariant + // -> verify the details of the diagnostic, including severity and message + // Ensure that you remove @generated or mark it @generated NOT + if (false) { + if (diagnostics != null) { + diagnostics.add + (new BasicDiagnostic + (Diagnostic.ERROR, + AlfValidator.DIAGNOSTIC_SOURCE, + AlfValidator.ARITHMETIC_EXPRESSION__ARITHMETIC_EXPRESSION_IS_CONCATENATION_DERIVATION, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "arithmeticExpressionIsConcatenationDerivation", EObjectValidator.getObjectLabel(this, context) }), + new Object[] { this })); + } + return false; + } + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean arithmeticExpressionTypeDerivation(DiagnosticChain diagnostics, Map<Object, Object> context) { + // TODO: implement this method + // -> specify the condition that violates the invariant + // -> verify the details of the diagnostic, including severity and message + // Ensure that you remove @generated or mark it @generated NOT + if (false) { + if (diagnostics != null) { + diagnostics.add + (new BasicDiagnostic + (Diagnostic.ERROR, + AlfValidator.DIAGNOSTIC_SOURCE, + AlfValidator.ARITHMETIC_EXPRESSION__ARITHMETIC_EXPRESSION_TYPE_DERIVATION, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "arithmeticExpressionTypeDerivation", EObjectValidator.getObjectLabel(this, context) }), + new Object[] { this })); + } + return false; + } + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean arithmeticExpressionLowerDerivation(DiagnosticChain diagnostics, Map<Object, Object> context) { + // TODO: implement this method + // -> specify the condition that violates the invariant + // -> verify the details of the diagnostic, including severity and message + // Ensure that you remove @generated or mark it @generated NOT + if (false) { + if (diagnostics != null) { + diagnostics.add + (new BasicDiagnostic + (Diagnostic.ERROR, + AlfValidator.DIAGNOSTIC_SOURCE, + AlfValidator.ARITHMETIC_EXPRESSION__ARITHMETIC_EXPRESSION_LOWER_DERIVATION, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "arithmeticExpressionLowerDerivation", EObjectValidator.getObjectLabel(this, context) }), + new Object[] { this })); + } + return false; + } + return true; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean arithmeticExpressionUpperDerivation(DiagnosticChain diagnostics, Map<Object, Object> context) { + // TODO: implement this method + // -> specify the condition that violates the invariant + // -> verify the details of the diagnostic, including severity and message + // Ensure that you remove @generated or mark it @generated NOT + if (false) { + if (diagnostics != null) { + diagnostics.add + (new BasicDiagnostic + (Diagnostic.ERROR, + AlfValidator.DIAGNOSTIC_SOURCE, + AlfValidator.ARITHMETIC_EXPRESSION__ARITHMETIC_EXPRESSION_UPPER_DERIVATION, + EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "arithmeticExpressionUpperDerivation", EObjectValidator.getObjectLabel(this, context) }), + new Object[] { this })); + } + return false; + } + return true; + } + + /** + * The cached validation expression for the '{@link #arithmeticExpressionOperandTypes(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Arithmetic Expression Operand Types</em>}' invariant operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #arithmeticExpressionOperandTypes(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + * @ordered + */ + protected static final String ARITHMETIC_EXPRESSION_OPERAND_TYPES_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION = "\n" + + " self.isIntegerType(self.operand1.type) and self.isIntegerType(self.operand2.type) or\n" + + " self.operator = '+' and self.isStringType(self.operand1.type) and self.isStringType(self.operand2.type)"; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean arithmeticExpressionOperandTypes(DiagnosticChain diagnostics, Map<Object, Object> context) { + return AlfValidator.validate + (AlfPackage.eINSTANCE.getArithmeticExpression(), + this, + diagnostics, + context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", + AlfPackage.eINSTANCE.getArithmeticExpression__ArithmeticExpressionOperandTypes__DiagnosticChain_Map(), + ARITHMETIC_EXPRESSION_OPERAND_TYPES_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, + Diagnostic.ERROR, + AlfValidator.DIAGNOSTIC_SOURCE, + AlfValidator.ARITHMETIC_EXPRESSION__ARITHMETIC_EXPRESSION_OPERAND_TYPES); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + @SuppressWarnings("unchecked") + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case AlfPackage.ARITHMETIC_EXPRESSION___TYPE: + return type(); + case AlfPackage.ARITHMETIC_EXPRESSION___LOWER: + return lower(); + case AlfPackage.ARITHMETIC_EXPRESSION___UPPER: + return upper(); + case AlfPackage.ARITHMETIC_EXPRESSION___ARITHMETIC_EXPRESSION_IS_CONCATENATION_DERIVATION__DIAGNOSTICCHAIN_MAP: + return arithmeticExpressionIsConcatenationDerivation((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + case AlfPackage.ARITHMETIC_EXPRESSION___ARITHMETIC_EXPRESSION_TYPE_DERIVATION__DIAGNOSTICCHAIN_MAP: + return arithmeticExpressionTypeDerivation((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + case AlfPackage.ARITHMETIC_EXPRESSION___ARITHMETIC_EXPRESSION_LOWER_DERIVATION__DIAGNOSTICCHAIN_MAP: + return arithmeticExpressionLowerDerivation((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + case AlfPackage.ARITHMETIC_EXPRESSION___ARITHMETIC_EXPRESSION_UPPER_DERIVATION__DIAGNOSTICCHAIN_MAP: + return arithmeticExpressionUpperDerivation((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + case AlfPackage.ARITHMETIC_EXPRESSION___ARITHMETIC_EXPRESSION_OPERAND_TYPES__DIAGNOSTICCHAIN_MAP: + return arithmeticExpressionOperandTypes((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + } + return super.eInvoke(operationID, arguments); + } + +} // ArithmeticExpressionImpl |