Added finder for the last wind fix in the race log

This commit is contained in:
Armin Zamani committed 2013-06-15 14:30:26 +02:00
1 parent ae0fc9dcb5
commit e056dba717
1 file changed
+28
@@ -0,0 +1,28 @@
package com.sap.sailing.domain.racelog.analyzing.impl;
import com.sap.sailing.domain.racelog.RaceLog;
import com.sap.sailing.domain.racelog.RaceLogEvent;
import com.sap.sailing.domain.racelog.RaceLogWindFixEvent;
import com.sap.sailing.domain.tracking.Wind;
public class LastWindFixFinder extends RaceLogAnalyzer<Wind> {
public LastWindFixFinder(RaceLog raceLog) {
super(raceLog);
}
@Override
protected Wind performAnalyzation() {
Wind lastWind = null;
for (RaceLogEvent event : getAllEvents()) {
if (event instanceof RaceLogWindFixEvent) {
RaceLogWindFixEvent windFixEvent = (RaceLogWindFixEvent) event;
lastWind = windFixEvent.getWindFix();
}
}
return lastWind;
}
}