Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/LowerOrEqual.java')
-rw-r--r--extraplugins/moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/LowerOrEqual.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/extraplugins/moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/LowerOrEqual.java b/extraplugins/moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/LowerOrEqual.java
new file mode 100644
index 00000000000..445dea92ebc
--- /dev/null
+++ b/extraplugins/moka/org.eclipse.papyrus.moka.fuml.standardlibrary/src/org/eclipse/papyrus/moka/fuml/standardlibrary/library/real/LowerOrEqual.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.moka.fuml.standardlibrary.library.real;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.papyrus.infra.core.Activator;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.BooleanValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.RealValue;
+import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
+import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
+import org.eclipse.uml2.uml.PrimitiveType;
+
+public class LowerOrEqual extends OpaqueBehaviorExecution {
+
+ @Override
+ public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
+ try {
+ Double x = ((RealValue)inputParameters.get(0).values.get(0)).value;
+ Double y = ((RealValue)inputParameters.get(1).values.get(0)).value;
+ BooleanValue result = new BooleanValue();
+ result.value = x <= y;
+ List<Value> outputs = new ArrayList<Value>();
+ result.type = (PrimitiveType) this.locus.factory.getBuiltInType("Real");
+ outputs.add(result);
+ outputParameters.get(0).values = outputs;
+ } catch (Exception e) {
+ Activator.log.error("An error occured during the execution of <= " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public Value new_() {
+ return new LowerOrEqual();
+ }
+} \ No newline at end of file

Back to the top