1 | package de.uka.ipd.sdq.probespec.framework.utils; |
2 | |
3 | import java.util.Vector; |
4 | |
5 | import javax.measure.quantity.Quantity; |
6 | |
7 | import de.uka.ipd.sdq.probespec.framework.ProbeSample; |
8 | import de.uka.ipd.sdq.probespec.framework.ProbeSetSample; |
9 | import de.uka.ipd.sdq.probespec.framework.ProbeSpecContext; |
10 | import de.uka.ipd.sdq.probespec.framework.RequestContext; |
11 | |
12 | public class ProbeSpecUtils { |
13 | |
14 | public static ProbeSetSample buildProbeSetSample( |
15 | ProbeSample<?, ? extends Quantity> sample, |
16 | RequestContext requestContextID, String modelElementId, |
17 | Integer probeSetId) { |
18 | Vector<ProbeSample<?, ? extends Quantity>> probeSampleVector = new Vector<ProbeSample<?, ? extends Quantity>>(); |
19 | probeSampleVector.add(sample); |
20 | |
21 | ProbeSetSample pss = new ProbeSetSample(probeSampleVector, |
22 | requestContextID, modelElementId, probeSetId); |
23 | return pss; |
24 | } |
25 | |
26 | public static ProbeSetSample buildProbeSetSample( |
27 | ProbeSample<?, ? extends Quantity> sample1, |
28 | ProbeSample<?, ? extends Quantity> sample2, |
29 | RequestContext requestContextID, String modelElementId, |
30 | Integer probeSetId) { |
31 | Vector<ProbeSample<?, ? extends Quantity>> probeSampleVector = new Vector<ProbeSample<?, ? extends Quantity>>(); |
32 | probeSampleVector.add(sample1); |
33 | probeSampleVector.add(sample2); |
34 | |
35 | ProbeSetSample pss = new ProbeSetSample(probeSampleVector, |
36 | requestContextID, modelElementId, probeSetId); |
37 | return pss; |
38 | } |
39 | |
40 | public static String ProbeSetIdToString(Integer probeSetId, ProbeSpecContext ctx) { |
41 | return probeSetId + " <" + ctx.obtainOriginalProbeSetId(probeSetId) + ">"; |
42 | } |
43 | |
44 | } |