Skip to content

Commit 2b1636a

Browse files
committed
Improved documentation
1 parent 8c48adb commit 2b1636a

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/main/java/pt/lsts/aismanager/ShipAisSnapshot.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ public class ShipAisSnapshot {
1919
* Create a snapshot of ship's AIS information
2020
*
2121
* @param mmsi Maritime Mobile Service Identity
22-
* @param sog Speed over ground
23-
* @param cog Course over ground
24-
* @param heading Heading
22+
* @param sogKnots Speed over ground in knots
23+
* @param cogRads Course over ground in radians
24+
* @param headingRads Heading in radians
2525
* @param latRads Latitude in radians
2626
* @param lonRads Longitude in radians
2727
* @param timestampMs Timestamp in Milliseconds
2828
* @param label AIS label
2929
* */
30-
public ShipAisSnapshot(int mmsi, double sog, double cog, double heading, double latRads, double lonRads,
30+
public ShipAisSnapshot(int mmsi, double sogKnots, double cogRads, double headingRads, double latRads, double lonRads,
3131
long timestampMs, String label) {
3232
this.mmsi = mmsi;
33-
this.sog = sog;
34-
this.cog = cog;
35-
this.heading = heading;
33+
this.sog = sogKnots;
34+
this.cog = cogRads;
35+
this.heading = headingRads;
3636
this.latRads = latRads;
3737
this.lonRads = lonRads;
3838
this.timestampMs = timestampMs;
@@ -68,7 +68,7 @@ public double getCog() {
6868
}
6969

7070
/**
71-
* Ship's Heading
71+
* Ship's Heading in radians
7272
* */
7373
public double getHeading() {
7474
return heading;
@@ -88,10 +88,16 @@ public double getLonRads() {
8888
return lonRads;
8989
}
9090

91+
/**
92+
* Ship's latitude in degrees
93+
* */
9194
public double getLatDegs() {
9295
return Math.toDegrees(latRads);
9396
}
9497

98+
/**
99+
* Ship's longitude in degrees
100+
* */
95101
public double getLonDegs() {
96102
return Math.toDegrees(lonRads);
97103
}

src/main/java/pt/lsts/aismanager/api/AisContactManager.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ private AisContactManager() {
3535
*/
3636
private final HashMap<Integer, Deque<ShipAisSnapshot>> snapshots = new HashMap<>();
3737

38-
public void setShipPosition(int mmsi, double sog, double cog, double heading, double latRads, double lonRads,
38+
/***
39+
*
40+
* */
41+
public void setShipPosition(int mmsi, double sogKnots, double cog, double heading, double latRads, double lonRads,
3942
long timestamp, String label) {
40-
ShipAisSnapshot shipSnapshot = new ShipAisSnapshot(mmsi, sog, cog, heading, latRads, lonRads, timestamp, label);
43+
ShipAisSnapshot shipSnapshot = new ShipAisSnapshot(mmsi, sogKnots, cog, heading, latRads, lonRads, timestamp, label);
4144

4245
synchronized (manager.snapshots) {
4346
Deque<ShipAisSnapshot> stack = manager.snapshots.get(mmsi);

0 commit comments

Comments
 (0)