1 package au.gov.amsa.navigation; 2 3 import au.gov.amsa.risky.format.Fix; 4 import au.gov.amsa.risky.format.HasFix; 5 6 public class DriftCandidate implements HasFix { 7 8 private final HasFix fix; 9 private final long driftingSince; 10 11 public DriftCandidate(HasFix fix, long driftingSince) { 12 this.fix = fix; 13 this.driftingSince = driftingSince; 14 } 15 16 public HasFix fixWwrapper() { 17 return fix; 18 } 19 20 @Override 21 public Fix fix() { 22 return fix.fix(); 23 } 24 25 public long driftingSince() { 26 return driftingSince; 27 } 28 29 @Override 30 public String toString() { 31 return "DriftCandidate [driftingDurationMinutes=" + (fix.fix().time() - driftingSince) 32 / 60000.0 + ", fix=" + fix + "]"; 33 } 34 35 }