From cb87dcf242fbdf376b7a8d0e51f8410da51afe62 Mon Sep 17 00:00:00 2001 From: brutzman <brutzman@nps.edu> Date: Thu, 1 Jul 2021 18:27:22 -0700 Subject: [PATCH] javadoc --- examples/DisShooting/src/DisShooting/NetworkComms.java | 9 ++++++++- .../DisShooting/src/DisShooting/SimulationRunner.java | 4 +++- examples/DisShooting/src/DisShooting/Sniper.java | 2 ++ examples/DisShooting/src/DisShooting/Target.java | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/DisShooting/src/DisShooting/NetworkComms.java b/examples/DisShooting/src/DisShooting/NetworkComms.java index c72ecbca7a..ddc743154d 100644 --- a/examples/DisShooting/src/DisShooting/NetworkComms.java +++ b/examples/DisShooting/src/DisShooting/NetworkComms.java @@ -32,6 +32,8 @@ public class NetworkComms implements Runnable /** people we notify when we receive a PDU */ private List<PduListener> listeners; + /** provide reference to this object + * @return reference to this object */ public static NetworkComms getInstance() { synchronized(NetworkComms.class) @@ -110,7 +112,8 @@ public class NetworkComms implements Runnable socket.close(); } } - + /** Send a PDU + * @param aPdu to send */ public void sendPdu(Pdu aPdu) { aPdu.setTimestamp(time.getDisAbsoluteTimestamp()); @@ -125,11 +128,15 @@ public class NetworkComms implements Runnable } } + /** add a PduListener, if not already present + * @param aListener PduListener reference to add */ public void addListener(PduListener aListener) { listeners.add(aListener); } + /** remove a PduListener, if present + * @param aListener PduListener reference to remove */ public void removeListener(PduListener aListener) { listeners.remove(aListener); diff --git a/examples/DisShooting/src/DisShooting/SimulationRunner.java b/examples/DisShooting/src/DisShooting/SimulationRunner.java index 71f18b8e87..fc661af4b2 100644 --- a/examples/DisShooting/src/DisShooting/SimulationRunner.java +++ b/examples/DisShooting/src/DisShooting/SimulationRunner.java @@ -16,6 +16,7 @@ import edu.nps.moves.dis7.pdus.*; */ public class SimulationRunner { + /** three strikes you're out! */ public final static int FIRING_ATTEMPTS = 3; private static NetworkComms networkComms = null; @@ -226,7 +227,8 @@ public class SimulationRunner PduListenerImpl.ENTITIES.clear(); } } - + /** wait before next activity + * @param ms duration in milliseconds */ public static void sleep(long ms) { try { diff --git a/examples/DisShooting/src/DisShooting/Sniper.java b/examples/DisShooting/src/DisShooting/Sniper.java index fb8de97589..18b447e09d 100644 --- a/examples/DisShooting/src/DisShooting/Sniper.java +++ b/examples/DisShooting/src/DisShooting/Sniper.java @@ -17,6 +17,8 @@ public class Sniper implements Runnable Vector3Double disCoordinates; EntityID eId; + /** provide reference to this object + * @return reference to this object */ public static Sniper getInstance() { if (sniper == null) { sniper = new Sniper(); diff --git a/examples/DisShooting/src/DisShooting/Target.java b/examples/DisShooting/src/DisShooting/Target.java index 5b73a0f395..68d5c22811 100644 --- a/examples/DisShooting/src/DisShooting/Target.java +++ b/examples/DisShooting/src/DisShooting/Target.java @@ -19,6 +19,8 @@ public class Target implements Runnable { private static Target target = null; private EntityID eId; + /** provide reference to this object + * @return reference to this object */ public static Target getInstance() { if (target == null) { target = new Target(); -- GitLab