turned timeInMilliseconds into a Long, returning null if leg hasn't started yet

This commit is contained in:
Axel Uhl
2012-03-18 10:23:55 +01:00
parent 5e1e724c7e
commit 6b124da7e3
5 changed files with 11 additions and 8 deletions
@@ -18,11 +18,11 @@ public interface TrackedLegOfCompetitor {
/**
* How much time did the {@link #getCompetitor competitor} spend in this {@link #getLeg() leg} at
* <code>timePoint</code>? If the competitor hasn't started the leg yet at <code>timePoint</code>, 0 is returned. If the
* competitor has finished the leg already at <code>timePoint</code>, the time it took the competitor to
* complete the leg is returned.
* <code>timePoint</code>? If the competitor hasn't started the leg yet at <code>timePoint</code>, <code>null</code>
* is returned. If the competitor has finished the leg already at <code>timePoint</code>, the time it took the
* competitor to complete the leg is returned.
*/
long getTimeInMilliSeconds(TimePoint timePoint);
Long getTimeInMilliSeconds(TimePoint timePoint);
/**
* The distance over ground traveled by the competitor in this leg up to <code>timePoint</code>. If
@@ -19,7 +19,7 @@ public class LegEntryDTO implements IsSerializable {
public Double currentSpeedOverGroundInKnots;
public Double velocityMadeGoodInKnots;
public Double windwardDistanceToGoInMeters;
public long timeInMilliseconds;
public Long timeInMilliseconds;
public boolean started;
public boolean finished;
public Integer numberOfJibes;
@@ -76,7 +76,8 @@ public class GPSPerRace extends Action {
posGL = legRank - previousLeg.getTrackedLeg(competitor).getRank(time);
}
final Double gapToLeader = trackedLegOfCompetitor.getGapToLeaderInSeconds(time);
final double legTime = 1. / 1000. * trackedLegOfCompetitor.getTimeInMilliSeconds(time);
final Long timeInMilliSeconds = trackedLegOfCompetitor.getTimeInMilliSeconds(time);
final double legTime = 1. / 1000. * (timeInMilliSeconds==null?0:timeInMilliSeconds);
final Speed avgSpeed = trackedLegOfCompetitor.getAverageSpeedOverGround(time);
final Distance distanceSailed = trackedLegOfCompetitor.getDistanceTraveled(time);
@@ -74,7 +74,8 @@ public class RankPerLeg extends Action {
posGL = legRank - previousLeg.getTrackedLeg(competitor).getRank(time);
}
final Double gapToLeader = trackedLegOfCompetitor.getGapToLeaderInSeconds(time);
final double legTime = 1. / 1000. * trackedLegOfCompetitor.getTimeInMilliSeconds(time);
final Long timeInMilliSeconds = trackedLegOfCompetitor.getTimeInMilliSeconds(time);
final double legTime = 1. / 1000. * (timeInMilliSeconds==null?0:timeInMilliSeconds);
final Speed avgSpeed = trackedLegOfCompetitor.getAverageSpeedOverGround(time);
final Distance distanceSailed = trackedLegOfCompetitor.getDistanceTraveled(time);
@@ -79,7 +79,8 @@ public class RankPerLeg2 extends Action {
posGL = legRank - previousLeg.getTrackedLeg(competitor).getRank(time);
}
final Double gapToLeader = trackedLegOfCompetitor.getGapToLeaderInSeconds(time);
final double legTime = 1. / 1000. * trackedLegOfCompetitor.getTimeInMilliSeconds(time);
final Long timeInMilliSeconds = trackedLegOfCompetitor.getTimeInMilliSeconds(time);
final double legTime = 1. / 1000. * (timeInMilliSeconds==null?0:timeInMilliSeconds);
final Speed avgSpeed = trackedLegOfCompetitor.getAverageSpeedOverGround(time);
final Distance distanceSailed = trackedLegOfCompetitor.getDistanceTraveled(time);