| 1 | /** |
| 2 | * |
| 3 | */ |
| 4 | package de.fzi.se.quality.util; |
| 5 | |
| 6 | /**Class with helper function for StoEx processing. |
| 7 | * @author groenda |
| 8 | * |
| 9 | */ |
| 10 | public class StoExHelper { |
| 11 | |
| 12 | /**StoEx for the mathematical function max(leftSpecification,rightSpecification). |
| 13 | * @param leftSpecification Left specification. |
| 14 | * @param rightSpecification Right specification. |
| 15 | * @return StoEx specification for the function. |
| 16 | */ |
| 17 | public static String stoExMax(String leftSpecification, String rightSpecification) { |
| 18 | return "Max(" + leftSpecification + ", " + rightSpecification + ")"; |
| 19 | } |
| 20 | |
| 21 | /**StoEx for the mathematical function min(leftSpecification,rightSpecification). |
| 22 | * @param leftSpecification Left specification. |
| 23 | * @param rightSpecification Right specification. |
| 24 | * @return StoEx specification for the function. |
| 25 | */ |
| 26 | public static String stoExMin(String leftSpecification, String rightSpecification) { |
| 27 | return "Min(" + leftSpecification + ", " + rightSpecification + ")"; |
| 28 | } |
| 29 | |
| 30 | /**StoEx for the mathematical function (leftSpecification - rightSpecification). |
| 31 | * @param leftSpecification Left specification. |
| 32 | * @param rightSpecification Right specification. |
| 33 | * @return StoEx specification for the function. |
| 34 | */ |
| 35 | public static String stoExMinus(String leftSpecification, String rightSpecification) { |
| 36 | return "(" + leftSpecification + ") - (" + rightSpecification + ")"; |
| 37 | } |
| 38 | |
| 39 | /**StoEx for the mathematical function (leftSpecification + rightSpecification). |
| 40 | * @param leftSpecification Left specification. |
| 41 | * @param rightSpecification Right specification. |
| 42 | * @return StoEx specification for the function. |
| 43 | */ |
| 44 | public static String stoExPlus(String leftSpecification, String rightSpecification) { |
| 45 | return "(" + leftSpecification + ") + (" + rightSpecification + ")"; |
| 46 | } |
| 47 | |
| 48 | /**StoEx for the mathematical function (leftSpecification * rightSpecification). |
| 49 | * @param leftSpecification Left specification. |
| 50 | * @param rightSpecification Right specification. |
| 51 | * @return StoEx specification for the function. |
| 52 | */ |
| 53 | public static String stoExMul(String leftSpecification, String rightSpecification) { |
| 54 | return "(" + leftSpecification + ") * (" + rightSpecification + ")"; |
| 55 | } |
| 56 | } |