Last change
on this file since 1102 was 1102, checked in by davidb, 6 years ago |
Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING
|
File size:
1.2 KB
|
Line | |
---|
1 | package org.apollo.agents;
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * An immutable search result for melody searches.
|
---|
5 | *
|
---|
6 | * @author Brook Novak
|
---|
7 | *
|
---|
8 | */
|
---|
9 | public class MelodySearchResult implements Comparable<MelodySearchResult> {
|
---|
10 |
|
---|
11 | private String parentFrame;
|
---|
12 | private float score;
|
---|
13 | private String trackName ;
|
---|
14 | private String trackLocalFileName;
|
---|
15 |
|
---|
16 | public MelodySearchResult(String parentFrame, float score, String trackName, String trackLocalFileName) {
|
---|
17 | assert(parentFrame != null);
|
---|
18 | assert(trackLocalFileName != null);
|
---|
19 | assert(score >= 0);
|
---|
20 |
|
---|
21 | this.parentFrame = parentFrame;
|
---|
22 | this.score = score;
|
---|
23 | this.trackName = trackName;
|
---|
24 | this.trackLocalFileName = trackLocalFileName;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public String getParentFrame() {
|
---|
28 | return parentFrame;
|
---|
29 | }
|
---|
30 |
|
---|
31 | public float getScore() {
|
---|
32 | return score;
|
---|
33 | }
|
---|
34 |
|
---|
35 | public String getTrackLocalFileName() {
|
---|
36 | return trackLocalFileName;
|
---|
37 | }
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Can be null.
|
---|
41 | * @return
|
---|
42 | */
|
---|
43 | public String getTrackName() {
|
---|
44 | return trackName;
|
---|
45 | }
|
---|
46 |
|
---|
47 | public int compareTo(MelodySearchResult o) {
|
---|
48 | return Float.compare(score, o.score);
|
---|
49 | }
|
---|
50 |
|
---|
51 | /*public int compareTo(Object o) {
|
---|
52 |
|
---|
53 | if (o != null && o instanceof MelodySearchResult) {
|
---|
54 | return Float.compare(score, ((MelodySearchResult)o).score);
|
---|
55 | }
|
---|
56 | throw new ClassCastException();
|
---|
57 | }*/
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|
62 |
|
---|
63 |
|
---|
64 | }
|
---|
65 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.