| 1 | package de.uka.ipd.sdq.probespec.framework.matching; |
| 2 | |
| 3 | import javax.measure.quantity.Quantity; |
| 4 | |
| 5 | import de.uka.ipd.sdq.probespec.framework.ProbeSample; |
| 6 | |
| 7 | /** |
| 8 | * This MatchRule is able to decide whether the passed {@link ProbeSample} |
| 9 | * originates from the Probe with the specified probe id. |
| 10 | * |
| 11 | * @author pmerkle |
| 12 | * |
| 13 | */ |
| 14 | public class ProbeIDMatchRule implements IMatchRule { |
| 15 | |
| 16 | private String probeID; |
| 17 | |
| 18 | /** |
| 19 | * Class constructor specifying the probe id to match. |
| 20 | * |
| 21 | * @param probeID |
| 22 | * the probe id to match |
| 23 | */ |
| 24 | public ProbeIDMatchRule(String probeID) { |
| 25 | super(); |
| 26 | this.probeID = probeID; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Checks whether the passed ProbeSample originates from the probe with the |
| 31 | * probe id which has been passed using the constructor. |
| 32 | */ |
| 33 | @Override |
| 34 | public boolean match(ProbeSample<?, ? extends Quantity> sample) { |
| 35 | return sample.getProbeID().equals(probeID); |
| 36 | } |
| 37 | |
| 38 | } |