mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-30 15:57:11 +00:00
pulled up all but the Named-related methods from com.sap.sailing.common.Util to com.sap.sse.common.Util; further prepared for Regatta search on RacingEventService
This commit is contained in:
1 parent
0c47e86304
commit
5b038779db
11 files changed
+298
-196
No files matched your search
+7
@@ -0,0 +1,7 @@
|
||||
package com.sap.sailing.server;
|
||||
|
||||
import com.sap.sse.common.search.Hit;
|
||||
|
||||
public interface RegattaSearchResult extends Hit {
|
||||
|
||||
}
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
package com.sap.sailing.server.impl;
|
||||
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sailing.server.RegattaSearchResult;
|
||||
import com.sap.sse.common.search.KeywordQuery;
|
||||
import com.sap.sse.common.search.Result;
|
||||
import com.sap.sse.common.search.ResultImpl;
|
||||
|
||||
/**
|
||||
* Searches a {@link RacingEventService} instance for regattas that somehow match with a
|
||||
* {@link KeywordQuery}. Several attributes on the way are considered, in particular the event
|
||||
* name (if a regatta is somehow linked to an event), the event's venue name, the leaderboard group
|
||||
* name that contains a regatta leaderboard for the subject regatta, the regatta name itself,
|
||||
* the regatta's boat class name, and the names of all competitors entered into the regatta.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
*/
|
||||
public class RegattaByKeywordSearchService {
|
||||
Result<RegattaSearchResult> search(RacingEventService service, KeywordQuery query) {
|
||||
ResultImpl<RegattaSearchResult> result = new ResultImpl<>(query, new RegattaSearchResultRanker());
|
||||
for (Regatta regatta : service.getAllRegattas()) {
|
||||
// TODO continue here...
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
package com.sap.sailing.server.impl;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.sap.sailing.server.RegattaSearchResult;
|
||||
|
||||
public class RegattaSearchResultRanker implements Comparator<RegattaSearchResult> {
|
||||
@Override
|
||||
public int compare(RegattaSearchResult o1, RegattaSearchResult o2) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user