mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 19:20:04 +00:00
Merge branch 'bug2059' into bug4227
This commit is contained in:
commit
85c112140c
469 files changed
+13313
-3737
No files matched your search
@@ -50,5 +50,7 @@ Export-Package: com.sap.sailing.domain.abstractlog,
|
||||
com.sap.sailing.domain.base.racegroup.impl,
|
||||
com.sap.sailing.domain.racelogtracking,
|
||||
com.sap.sailing.domain.racelogtracking.impl,
|
||||
com.sap.sailing.domain.statistics,
|
||||
com.sap.sailing.domain.statistics.impl,
|
||||
com.sap.sailing.domain.tracking,
|
||||
com.sap.sailing.domain.tracking.impl
|
||||
+5
@@ -250,4 +250,9 @@ public class NoAddingRaceLogWrapper implements RaceLog {
|
||||
public void revokeEvent(AbstractLogEventAuthor author, RaceLogEvent toRevoke) throws NotRevokableException {
|
||||
innerRaceLog.revokeEvent(author, toRevoke);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return innerRaceLog.size();
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -11,8 +11,13 @@ import com.sap.sse.datamining.annotations.Connector;
|
||||
import com.sap.sse.datamining.annotations.Dimension;
|
||||
|
||||
public interface Competitor extends NamedWithID, IsManagedByCache<SharedDomainFactory> {
|
||||
@Connector(messageKey="Team", ordinal=9)
|
||||
Team getTeam();
|
||||
|
||||
/**
|
||||
* Short for {@link #getTeam()}.{@link Team#getNationality() getNationality()}.
|
||||
*/
|
||||
@Connector(messageKey="Nationality", ordinal=9)
|
||||
Nationality getNationality();
|
||||
|
||||
@Connector(messageKey="Boat", ordinal=10)
|
||||
Boat getBoat();
|
||||
|
||||
+6
@@ -9,6 +9,7 @@ import java.util.Set;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CompetitorChangeListener;
|
||||
import com.sap.sailing.domain.base.Nationality;
|
||||
import com.sap.sailing.domain.base.SharedDomainFactory;
|
||||
import com.sap.sse.common.Color;
|
||||
import com.sap.sse.common.Duration;
|
||||
@@ -78,6 +79,11 @@ public class CompetitorImpl implements DynamicCompetitor {
|
||||
return team;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Nationality getNationality() {
|
||||
return getTeam() == null ? null : getTeam().getNationality();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicBoat getBoat() {
|
||||
return boat;
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.sap.sailing.domain.statistics;
|
||||
|
||||
import com.sap.sailing.domain.common.Distance;
|
||||
|
||||
/**
|
||||
* A {@link Statistics} object represents several statistical information.
|
||||
*/
|
||||
public interface Statistics {
|
||||
|
||||
/**
|
||||
* @return the number of competitors
|
||||
*/
|
||||
int getNumberOfCompetitors();
|
||||
|
||||
/**
|
||||
* @return the number of regattas
|
||||
*/
|
||||
int getNumberOfRegattas();
|
||||
|
||||
/**
|
||||
* @return the number of races
|
||||
*/
|
||||
int getNumberOfRaces();
|
||||
|
||||
/**
|
||||
* @return the number of tracked races
|
||||
*/
|
||||
int getNumberOfTrackedRaces();
|
||||
|
||||
/**
|
||||
* @return the number of GPS fixes
|
||||
*/
|
||||
long getNumberOfGPSFixes();
|
||||
|
||||
/**
|
||||
* @return the number of wind fixes
|
||||
*/
|
||||
long getNumberOfWindFixes();
|
||||
|
||||
/**
|
||||
* @return the totally sailed {@link Distance}; never {@code null}
|
||||
*/
|
||||
Distance getDistanceTraveled();
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.sap.sailing.domain.statistics.impl;
|
||||
|
||||
import com.sap.sailing.domain.common.Distance;
|
||||
import com.sap.sailing.domain.statistics.Statistics;
|
||||
|
||||
public class StatisticsImpl implements Statistics {
|
||||
|
||||
private final int numberOfCompetitors;
|
||||
private final int numberOfRegattas;
|
||||
private final int numberOfRaces;
|
||||
private final int numberOfTrackedRaces;
|
||||
private final long numberOfGPSFixes;
|
||||
private final long numberOfWindFixes;
|
||||
private final Distance distanceTraveled;
|
||||
|
||||
/**
|
||||
* @param distanceTraveled
|
||||
* if {@code null} then {@link #getDistanceTraveled()} will return {@link Distance#NULL} instead; this
|
||||
* way, the distance reported by this object can easily be aggregated with other distances without
|
||||
* further {@code null} checks.
|
||||
*/
|
||||
public StatisticsImpl(int numberOfCompetitors, int numberOfRegattas, int numberOfRaces, int numberOfTrackedRaces,
|
||||
long numberOfGPSFixes, long numberOfWindFixes, Distance distanceTraveled) {
|
||||
super();
|
||||
this.numberOfCompetitors = numberOfCompetitors;
|
||||
this.numberOfRegattas = numberOfRegattas;
|
||||
this.numberOfRaces = numberOfRaces;
|
||||
this.numberOfTrackedRaces = numberOfTrackedRaces;
|
||||
this.numberOfGPSFixes = numberOfGPSFixes;
|
||||
this.numberOfWindFixes = numberOfWindFixes;
|
||||
this.distanceTraveled = distanceTraveled == null ? Distance.NULL : distanceTraveled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfCompetitors() {
|
||||
return numberOfCompetitors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfRegattas() {
|
||||
return numberOfRegattas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfRaces() {
|
||||
return numberOfRaces;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfTrackedRaces() {
|
||||
return numberOfTrackedRaces;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getNumberOfGPSFixes() {
|
||||
return numberOfGPSFixes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getNumberOfWindFixes() {
|
||||
return numberOfWindFixes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getDistanceTraveled() {
|
||||
return distanceTraveled;
|
||||
}
|
||||
}
|
||||
+10
@@ -184,4 +184,14 @@ public interface Track<FixType extends Timed> extends Serializable {
|
||||
* more than one raw fix in the track
|
||||
*/
|
||||
Duration getAverageIntervalBetweenRawFixes();
|
||||
|
||||
/**
|
||||
* @return the number of raw fixes contained in the Track.
|
||||
*/
|
||||
int size();
|
||||
|
||||
/**
|
||||
* Tells whether the collection of {@link #getRawFixes() raw fixes} (no outliers removed) is empty
|
||||
*/
|
||||
boolean isEmpty();
|
||||
}
|
||||
+10
@@ -378,4 +378,14 @@ public class TrackImpl<FixType extends Timed> implements Track<FixType> {
|
||||
unlockAfterRead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return fixes.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return fixes.isEmpty();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user