| 1 | package de.uka.ipd.sdq.probespec.framework.calculator; |
| 2 | |
| 3 | import java.util.Vector; |
| 4 | |
| 5 | import javax.measure.unit.SI; |
| 6 | |
| 7 | import de.uka.ipd.sdq.pipesandfilters.framework.CaptureType; |
| 8 | import de.uka.ipd.sdq.pipesandfilters.framework.MeasurementMetric; |
| 9 | import de.uka.ipd.sdq.pipesandfilters.framework.Scale; |
| 10 | import de.uka.ipd.sdq.probespec.framework.ProbeSpecContext; |
| 11 | |
| 12 | /** |
| 13 | * Calculates a time span representing the hold time. |
| 14 | * |
| 15 | * @author Philipp Merkle |
| 16 | */ |
| 17 | public class HoldTimeCalculator extends TimeSpanCalculator { |
| 18 | |
| 19 | private static Vector<MeasurementMetric> concreteMeasurementMetrics; |
| 20 | |
| 21 | /** |
| 22 | * Default Constructor. |
| 23 | * |
| 24 | * @param ctx |
| 25 | * the {@link ProbeSpecContext} |
| 26 | * @param startHoldProbeSetID |
| 27 | * references the ProbeSet which represents the starting point for the hold time |
| 28 | * measurement |
| 29 | * @param stopHoldProbeSetID |
| 30 | * references the ProbeSet which represents the final point for the hold time |
| 31 | * measurement |
| 32 | */ |
| 33 | public HoldTimeCalculator(ProbeSpecContext ctx, Integer startHoldProbeSetID, Integer stopHoldProbeSetID) { |
| 34 | super(ctx, startHoldProbeSetID, stopHoldProbeSetID); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Initializes the metric information for the result of this calculator |
| 39 | * type. The method is called by the constructor of the super class. |
| 40 | */ |
| 41 | @Override |
| 42 | protected synchronized Vector<MeasurementMetric> getConcreteMeasurementMetrics() { |
| 43 | if (concreteMeasurementMetrics == null) { |
| 44 | concreteMeasurementMetrics = new Vector<MeasurementMetric>(); |
| 45 | MeasurementMetric mm = new MeasurementMetric( |
| 46 | CaptureType.NATURAL_NUMBER, SI.MILLI(SI.SECOND), |
| 47 | Scale.ORDINAL); |
| 48 | mm.setDescription("This measure represents the hold time"); |
| 49 | mm.setMonotonic(false); |
| 50 | mm.setName("Hold Time"); |
| 51 | mm.setStrongMonotonic(false); |
| 52 | concreteMeasurementMetrics.add(mm); |
| 53 | } |
| 54 | return concreteMeasurementMetrics; |
| 55 | } |
| 56 | |
| 57 | } |