Skip to content
Snippets Groups Projects
Commit fa835083 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

added javadoc to clear warnings

parent 9e918c21
No related branches found
No related tags found
No related merge requests found
Showing
with 557 additions and 421 deletions
...@@ -31,6 +31,10 @@ public class AlphabeticalPduSender ...@@ -31,6 +31,10 @@ public class AlphabeticalPduSender
private int port; private int port;
InetAddress multicastAddress; InetAddress multicastAddress;
/** Constructor
* @param port socket port number
* @param multicast multicast address
*/
public AlphabeticalPduSender(int port, String multicast) public AlphabeticalPduSender(int port, String multicast)
{ {
try { try {
...@@ -45,6 +49,7 @@ public class AlphabeticalPduSender ...@@ -45,6 +49,7 @@ public class AlphabeticalPduSender
} }
} }
/** Invocable run method for this object */
public void run() public void run()
{ {
try { try {
...@@ -323,6 +328,9 @@ public class AlphabeticalPduSender ...@@ -323,6 +328,9 @@ public class AlphabeticalPduSender
} }
} }
/** Command-line invocation (CLI)
* @param args command-line arguments
*/
public static void main(String args[]) public static void main(String args[])
{ {
AlphabeticalPduSender sender; AlphabeticalPduSender sender;
......
...@@ -126,7 +126,11 @@ public class EntityStateEntityIdExampleUse ...@@ -126,7 +126,11 @@ public class EntityStateEntityIdExampleUse
// Do something here with the pdu you received // Do something here with the pdu you received
System.out.println("Received "+pdu.getClass().getSimpleName()); System.out.println("Received "+pdu.getClass().getSimpleName());
} }
/** Command-line invocation (CLI)
* @param args command-line arguments
* @throws java.lang.Exception if fails
*/
public static void main(String[] args) throws Exception public static void main(String[] args) throws Exception
{ {
EntityStateEntityIdExampleUse.exampleUse(); // run example showing use EntityStateEntityIdExampleUse.exampleUse(); // run example showing use
......
...@@ -28,6 +28,9 @@ import java.util.List; ...@@ -28,6 +28,9 @@ import java.util.List;
*/ */
public class EspduReceiver public class EspduReceiver
{ {
/** Command-line invocation (CLI)
* @param args command-line arguments
*/
public static void main(String args[]) public static void main(String args[])
{ {
MulticastSocket socket; MulticastSocket socket;
......
...@@ -21,6 +21,9 @@ import java.net.MulticastSocket; ...@@ -21,6 +21,9 @@ import java.net.MulticastSocket;
*/ */
public class EspduReceiverNIO public class EspduReceiverNIO
{ {
/** Command-line invocation (CLI)
* @param args command-line arguments
*/
public static void main(String args[]) public static void main(String args[])
{ {
MulticastSocket socket; MulticastSocket socket;
......
...@@ -22,11 +22,18 @@ import java.util.*; ...@@ -22,11 +22,18 @@ import java.util.*;
*/ */
public class EspduSender public class EspduSender
{ {
/** default value avoids unterminated zombie senders */
public static final int NUMBER_TO_SEND = 5000; public static final int NUMBER_TO_SEND = 5000;
/** TCP/IP network modes */
public enum NetworkMode public enum NetworkMode
{ {
UNICAST, MULTICAST, BROADCAST /** unicast socket */
UNICAST,
/** multicast socket */
MULTICAST,
/** broadcast socket */
BROADCAST
}; };
/** /**
......
...@@ -24,6 +24,9 @@ import java.net.MulticastSocket; ...@@ -24,6 +24,9 @@ import java.net.MulticastSocket;
*/ */
public class EspduSenderNIO public class EspduSenderNIO
{ {
/** Command-line invocation (CLI)
* @param args command-line arguments
*/
public static void main(String args[]) public static void main(String args[])
{ {
MulticastSocket socket; MulticastSocket socket;
......
...@@ -28,6 +28,9 @@ public class PduListenerSaver ...@@ -28,6 +28,9 @@ public class PduListenerSaver
PAUSED; PAUSED;
} }
/** Command-line invocation (CLI)
* @param args command-line arguments
*/
public static void main(String[] args) public static void main(String[] args)
{ {
String outputDirectoryPath = DEFAULT_OUTPUT_DIRECTORY; String outputDirectoryPath = DEFAULT_OUTPUT_DIRECTORY;
......
...@@ -29,6 +29,9 @@ public class PduReaderPlayer ...@@ -29,6 +29,9 @@ public class PduReaderPlayer
PAUSED; PAUSED;
} }
/** Command-line invocation (CLI)
* @param args command-line arguments
*/
public static void main(String[] args) public static void main(String[] args)
{ {
String outDir = DEFAULT_OUTPUTDIR; String outDir = DEFAULT_OUTPUTDIR;
......
...@@ -20,6 +20,9 @@ import edu.nps.moves.dis7.utilities.PduFactory; ...@@ -20,6 +20,9 @@ import edu.nps.moves.dis7.utilities.PduFactory;
*/ */
public class ThreadedNetExample public class ThreadedNetExample
{ {
/** Command-line invocation (CLI)
* @param args command-line arguments
*/
public static void main(String[] args) public static void main(String[] args)
{ {
// Create an instance of DisThreadedNetworkInterface using default port 3000, mcast 225.4.5.6, use other constructor to specific port and ip // Create an instance of DisThreadedNetworkInterface using default port 3000, mcast 225.4.5.6, use other constructor to specific port and ip
......
/**
* Example classes using edu.nps.moves.dis7 library.
*/
// https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java
package edu.nps.moves.dis7.examples;
...@@ -12,7 +12,9 @@ package edu.nps.moves.dis7.utilities; ...@@ -12,7 +12,9 @@ package edu.nps.moves.dis7.utilities;
*/ */
public class CoordinateConversions public class CoordinateConversions
{ {
/** conversion factor */
public static final double RADIANS_TO_DEGREES = 180.0/Math.PI; public static final double RADIANS_TO_DEGREES = 180.0/Math.PI;
/** conversion factor */
public static final double DEGREES_TO_RADIANS = Math.PI/180.0; public static final double DEGREES_TO_RADIANS = Math.PI/180.0;
private CoordinateConversions() private CoordinateConversions()
......
...@@ -24,11 +24,13 @@ import java.util.logging.Logger; ...@@ -24,11 +24,13 @@ import java.util.logging.Logger;
@Deprecated(since="dis7") @Deprecated(since="dis7")
public class TrialDisMulticastNetworkingDeprecated public class TrialDisMulticastNetworkingDeprecated
{ {
/** deprecated */
public class ByteArrayBufferAndLength public class ByteArrayBufferAndLength
{ {
public byte[] bufferByteArray; public byte[] bufferByteArray;
public int length; public int length;
/* deprecated do not use */
public ByteArrayBufferAndLength(byte[] bufferByteArray, int length) public ByteArrayBufferAndLength(byte[] bufferByteArray, int length)
{ {
this.bufferByteArray = bufferByteArray; this.bufferByteArray = bufferByteArray;
...@@ -46,11 +48,13 @@ public class TrialDisMulticastNetworkingDeprecated ...@@ -46,11 +48,13 @@ public class TrialDisMulticastNetworkingDeprecated
private InetSocketAddress group; private InetSocketAddress group;
private NetworkInterface ni; private NetworkInterface ni;
/* deprecated do not use */
public TrialDisMulticastNetworkingDeprecated() public TrialDisMulticastNetworkingDeprecated()
{ {
this(DisThreadedNetworkInterface.DEFAULT_DIS_PORT, DisThreadedNetworkInterface.DEFAULT_MULTICAST_ADDRESS); this(DisThreadedNetworkInterface.DEFAULT_DIS_PORT, DisThreadedNetworkInterface.DEFAULT_MULTICAST_ADDRESS);
} }
/* deprecated do not use */
public TrialDisMulticastNetworkingDeprecated(int port, String mcastgroup) public TrialDisMulticastNetworkingDeprecated(int port, String mcastgroup)
{ {
DIS_PORT = port; DIS_PORT = port;
...@@ -66,16 +70,19 @@ public class TrialDisMulticastNetworkingDeprecated ...@@ -66,16 +70,19 @@ public class TrialDisMulticastNetworkingDeprecated
dos = new DataOutputStream(baos); dos = new DataOutputStream(baos);
} }
/* deprecated do not use */
public int getPort() public int getPort()
{ {
return DIS_PORT; return DIS_PORT;
} }
/* deprecated do not use */
public String getIp() public String getIp()
{ {
return MCAST_GROUP; return MCAST_GROUP;
} }
/* deprecated do not use */
public void stop() public void stop()
{ {
if(rsocket != null) { if(rsocket != null) {
...@@ -88,7 +95,8 @@ public class TrialDisMulticastNetworkingDeprecated ...@@ -88,7 +95,8 @@ public class TrialDisMulticastNetworkingDeprecated
ssocket = null; ssocket = null;
} }
} }
/* deprecated do not use */
public Pdu receivePdu() throws IOException public Pdu receivePdu() throws IOException
{ {
PduFactory pduFactory = new PduFactory(); PduFactory pduFactory = new PduFactory();
...@@ -99,6 +107,7 @@ public class TrialDisMulticastNetworkingDeprecated ...@@ -99,6 +107,7 @@ public class TrialDisMulticastNetworkingDeprecated
private MulticastSocket rsocket; private MulticastSocket rsocket;
byte buffer[]; byte buffer[];
DatagramPacket packet; DatagramPacket packet;
/* deprecated do not use */
public ByteArrayBufferAndLength receiveRawPdu() throws IOException public ByteArrayBufferAndLength receiveRawPdu() throws IOException
{ {
rsocket = new MulticastSocket(DIS_PORT); rsocket = new MulticastSocket(DIS_PORT);
......
/**
* Utility classes supporting edu.nps.moves.dis7 library.
*/
// https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java
package edu.nps.moves.dis7.utilities;
...@@ -29,6 +29,7 @@ public class PduPlayer { ...@@ -29,6 +29,7 @@ public class PduPlayer {
/** PDU listener interface */ /** PDU listener interface */
public interface RawListener { public interface RawListener {
/** callback */
void receiveBytes(byte[] ba); void receiveBytes(byte[] ba);
} }
...@@ -37,15 +38,15 @@ public class PduPlayer { ...@@ -37,15 +38,15 @@ public class PduPlayer {
private int port; private int port;
private Thread thrd; private Thread thrd;
static final String ENCODING_BASE64 = "ENCODING_BASE64"; static final String ENCODING_BASE64 = "ENCODING_BASE64";
static final String ENCODING_PLAINTEXT = "ENCODING_PLAINTEXT"; static final String ENCODING_PLAINTEXT = "ENCODING_PLAINTEXT";
static final String ENCODING_BINARY = "ENCODING_BINARY"; // TODO likely requires different code path static final String ENCODING_BINARY = "ENCODING_BINARY"; // TODO likely requires different code path
static final String ENCODING_XML = "ENCODING_XML"; // TODO, repeat Open-DIS version 4 effort static final String ENCODING_XML = "ENCODING_XML"; // TODO, repeat Open-DIS version 4 effort
static final String ENCODING_EXI = "ENCODING_EXI"; // TODO, use Exificient or Nagasena libraries static final String ENCODING_EXI = "ENCODING_EXI"; // TODO, use Exificient or Nagasena libraries
static final String ENCODING_JSON = "ENCODING_JSON"; // TODO, repeat Open-DIS version 4 effort static final String ENCODING_JSON = "ENCODING_JSON"; // TODO, repeat Open-DIS version 4 effort
static final String ENCODING_CDIS = "ENCODING_CDIS"; // future work based on new SISO standard
static final String ENCODING_MAK_DATA_LOGGER = "ENCODING_MAK_DATA_LOGGER"; // verbose pretty-print. perhaps output only (MAK format itself is binary) static final String ENCODING_MAK_DATA_LOGGER = "ENCODING_MAK_DATA_LOGGER"; // verbose pretty-print. perhaps output only (MAK format itself is binary)
static final String ENCODING_WIRESHARK_DATA_LOGGER = "ENCODING_WIRESHARK_DATA_LOGGER"; // static final String ENCODING_WIRESHARK_DATA_LOGGER = "ENCODING_WIRESHARK_DATA_LOGGER"; //
static final String ENCODING_CDIS = "ENCODING_CDIS"; // future work based on new SISO standard
private static String pduLogEncoding = ENCODING_PLAINTEXT; // TODO use Java enumerations, generalize/share across library private static String pduLogEncoding = ENCODING_PLAINTEXT; // TODO use Java enumerations, generalize/share across library
...@@ -392,15 +393,17 @@ public class PduPlayer { ...@@ -392,15 +393,17 @@ public class PduPlayer {
} }
return returnValue; return returnValue;
} }
/** Start or resume this instance */
public void startResume() { public void startResume() {
paused = false; paused = false;
} }
/** Stop or pause this instance */
public void stopPause() { public void stopPause() {
paused = true; paused = true;
} }
/** End operation of this instance */
public void end() { public void end() {
closer(); closer();
} }
......
...@@ -28,6 +28,7 @@ import org.apache.commons.io.FilenameUtils; ...@@ -28,6 +28,7 @@ import org.apache.commons.io.FilenameUtils;
*/ */
public class PduRecorder implements PduReceiver public class PduRecorder implements PduReceiver
{ {
/** Character sentinel indicating remainder of line is a comment */
public static final String COMMENT_MARKER = "#"; public static final String COMMENT_MARKER = "#";
static String outputDirectoryPath = "./pduLog"; static String outputDirectoryPath = "./pduLog";
...@@ -126,17 +127,18 @@ public class PduRecorder implements PduReceiver ...@@ -126,17 +127,18 @@ public class PduRecorder implements PduReceiver
public static void setPduLogEncoding(String newPduLogEncoding) { public static void setPduLogEncoding(String newPduLogEncoding) {
pduLogEncoding = newPduLogEncoding; pduLogEncoding = newPduLogEncoding;
} }
/** Start or resume this instance */
public void startResume() public void startResume()
{ {
running = true; running = true;
} }
/** Stop or pause this instance */
public void stopPause() public void stopPause()
{ {
running = false; running = false;
} }
/** End operation of this instance */
public File end() public File end()
{ {
running = false; running = false;
......
...@@ -38,50 +38,74 @@ public class X3dCoordinates { ...@@ -38,50 +38,74 @@ public class X3dCoordinates {
this.theta = theta; this.theta = theta;
} }
/** accessor method for angle of rotation
* @return current value */
public double getPhi() { public double getPhi() {
return phi; return phi;
} }
/** accessor method to set angle of rotation
* @param phi new angle value */
public void setPhi(double phi) { public void setPhi(double phi) {
this.phi = phi; this.phi = phi;
} }
/** accessor method for angle of rotation
* @return current value */
public double getPsi() { public double getPsi() {
return psi; return psi;
} }
/** accessor method to set angle of rotation
* @param psi new angle value */
public void setPsi(double psi) { public void setPsi(double psi) {
this.psi = psi; this.psi = psi;
} }
/** accessor method for angle of rotation
* @return current value */
public double getTheta() { public double getTheta() {
return theta; return theta;
} }
/** accessor method to set angle of rotation
* @param theta new angle value */
public void setTheta(double theta) { public void setTheta(double theta) {
this.theta = theta; this.theta = theta;
} }
/** accessor method to get coordinate x value
* @return current value */
public double getX() { public double getX() {
return x; return x;
} }
/** accessor method to set coordinate x value
* @param x coordinate value to set */
public void setX(double x) { public void setX(double x) {
this.x = x; this.x = x;
} }
/** accessor method to get coordinate y value
* @return current value */
public double getY() { public double getY() {
return y; return y;
} }
/** accessor method to set coordinate y value
* @param y coordinate value to set */
public void setY(double y) { public void setY(double y) {
this.y = y; this.y = y;
} }
/** accessor method to get coordinate z value
* @return current value */
public double getZ() { public double getZ() {
return z; return z;
} }
/** accessor method to set coordinate z value
* @param z coordinate value to set */
public void setZ(double z) { public void setZ(double z) {
this.z = z; this.z = z;
} }
......
...@@ -35,6 +35,8 @@ public class X3dCreateInterpolators { ...@@ -35,6 +35,8 @@ public class X3dCreateInterpolators {
private NumberFormat coordinateNumberFormat = NumberFormat.getInstance(new Locale("en", "US")); private NumberFormat coordinateNumberFormat = NumberFormat.getInstance(new Locale("en", "US"));
// -------------------- End Variables for Position Interpolator // -------------------- End Variables for Position Interpolator
/** Default Constructor */
public X3dCreateInterpolators() { public X3dCreateInterpolators() {
//3 significant digits equals milimeter position accuracy and 0.001 radians = 0.0572963266634555 degrees //3 significant digits equals milimeter position accuracy and 0.001 radians = 0.0572963266634555 degrees
......
/**
* Streaming utility classes supporting edu.nps.moves.dis7 library.
*/
// https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java
package edu.nps.moves.dis7.utilities.stream;
/**
* Spatial utility classes supporting edu.nps.moves.dis7 library.
*/
// https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java
package edu.nps.moves.spatial;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment