1 | package de.uka.ipd.sdq.probespec.framework; |
2 | |
3 | import javax.measure.Measure; |
4 | import javax.measure.quantity.Quantity; |
5 | |
6 | /** |
7 | * Represents a sample which is taken for a probe. |
8 | * <p> |
9 | * Use this class to store any type of probe sample. Therefore the class |
10 | * parameters V and Q have to be specified which represents the sample type. |
11 | * |
12 | * @param <V> |
13 | * denotes the class of the taken sample (Integer, Long, ...) |
14 | * @param <Q> |
15 | * denotes the measured {@link Quantity} |
16 | * @author pmerkle |
17 | * |
18 | */ |
19 | public class ProbeSample<V, Q extends Quantity> { |
20 | |
21 | /** the measured value and its quantity. */ |
22 | private Measure<V, Q> measure; |
23 | |
24 | private String probeID; |
25 | |
26 | private ProbeType probeType; |
27 | |
28 | /** |
29 | * Class constructor specifying the measured value, the id and type of the |
30 | * probe. |
31 | * |
32 | * @param measure |
33 | * the measured value in conjunction with its {@link Quantity} |
34 | * @param probeID |
35 | * the id of the probe |
36 | * @param probeType |
37 | * the type of the probe |
38 | * @see Measure |
39 | * @see ProbeType |
40 | */ |
41 | public ProbeSample(final Measure<V, Q> measure, final String probeID, |
42 | final ProbeType probeType) { |
43 | super(); |
44 | this.measure = measure; |
45 | this.probeID = probeID; |
46 | this.probeType = probeType; |
47 | } |
48 | |
49 | /** |
50 | * Returns the encapsulated measured value in conjunction with its measured |
51 | * {@link Quantity}. |
52 | * |
53 | * @return the measured value and its quantity |
54 | * @see Measure |
55 | */ |
56 | public Measure<V, Q> getMeasure() { |
57 | return measure; |
58 | } |
59 | |
60 | /** |
61 | * Returns the id of the measured probe according to the underlying model. |
62 | * |
63 | * @return the probe id |
64 | */ |
65 | public String getProbeID() { |
66 | return probeID; |
67 | } |
68 | |
69 | /** |
70 | * Returns the type of the measured probe according to the underlying model. |
71 | * |
72 | * @return the probe type |
73 | * @see ProbeType |
74 | */ |
75 | public ProbeType getProbeType() { |
76 | return probeType; |
77 | } |
78 | |
79 | } |