-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMatchResult.java
More file actions
52 lines (47 loc) · 1.33 KB
/
MatchResult.java
File metadata and controls
52 lines (47 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import java.util.Objects;
/**
* Store the result of a sequence search.
* @author Dr. Jody Paul
* @version 2026-03-10
*/
public class MatchResult {
private final String algorithmName;
private final DNASequence bestSequence;
private final double score;
/**
* Creates a match result.
*
* @param algorithmName the name of the algorithm used
* @param bestSequence the best matching sequence
* @param score the score assigned to the best match
*/
public MatchResult(String algorithmName, DNASequence bestSequence, double score) {
this.algorithmName = Objects.requireNonNull(algorithmName, "algorithmName must not be null");
this.bestSequence = Objects.requireNonNull(bestSequence, "bestSequence must not be null");
this.score = score;
}
/**
* Returns the name of the algorithm used.
*
* @return the algorithm name
*/
public String getAlgorithmName() {
return algorithmName;
}
/**
* Returns the best matching sequence.
*
* @return the best matching DNA sequence
*/
public DNASequence getBestSequence() {
return bestSequence;
}
/**
* Returns the score of the best matching sequence.
*
* @return the best score
*/
public double getScore() {
return score;
}
}