added some Javadoc in the trackfiles import stuff

This commit is contained in:
Axel Uhl committed 2014-05-30 10:15:37 +02:00
1 parent 9f771d8bad
commit 200da4bdff
5 files changed
+49 -23

No files matched your search

@@ -7,9 +7,18 @@ import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.impl.GPSFixMovingImpl;
/**
* Provide inference functionality.
* When an importer only provides latitude/longitude positions but no course over ground (COG) and no speed over ground
* (SOG) values, this class infers the COG/SOG values from the positions and timestamps of the basic fixes. Objects of this
* class are stateful in the sense that each call to {@link #addFixAndInfer(com.sap.sailing.domain.trackimport.GPSFixImporter.Callback, boolean, GPSFix)}
* remembers the fix just handled. The {@link #addFixAndInfer(com.sap.sailing.domain.trackimport.GPSFixImporter.Callback, boolean, GPSFix)} method
* therefore needs to be invoked with the fixes in ascending time point order.<p>
*
* If the fixes delivered to {@link #addFixAndInfer(com.sap.sailing.domain.trackimport.GPSFixImporter.Callback, boolean, GPSFix)} are
* already of type {@link GPSFixMoving}, they are used as-is. Otherwise, except for the first fix which is dropped, COG/SOG values
* will be inferred, a {@link GPSFixMoving} will be constructed and forwarded to the callback instance.
*
* @author Fredrik Teschke
*
*
*/
public abstract class BaseGPSFixImporterImpl implements GPSFixImporter {
private GPSFix previousFix;
@@ -23,7 +32,6 @@ public abstract class BaseGPSFixImporterImpl implements GPSFixImporter {
SpeedWithBearing speedWithBearing = previousFix.getSpeedAndBearingRequiredToReach(fix);
fix = new GPSFixMovingImpl(fix.getPosition(), fix.getTimePoint(), speedWithBearing);
}
previousFix = fix;
callback.addFix(fix);
}
@@ -19,6 +19,12 @@ public class GPSFixImporterRegistration {
return properties;
}
/**
* Registers the <code>importer</code> as an OSGi service for the {@link GPSFixImporter} interface, once for each
* {@link GPSFixImporter#getSupportedFileExtensions() supported file extension} , using its
* {@link GPSFixImporter#getType() type} as the {@link TypeBasedServiceFinder#TYPE} property and the
* file extension as the {@link GPSFixImporter#FILE_EXTENSION_PROPERTY} property.
*/
public static Collection<ServiceRegistration<GPSFixImporter>>
register(GPSFixImporter importer, BundleContext context) {
List<ServiceRegistration<GPSFixImporter>> registrations = new ArrayList<>();