diff --git a/build.xml b/build.xml index 5d9bf460ca69e72c7c754bb9d223d904faeacf99..87ee566be3be1b4d323bc688147d564813977379 100644 --- a/build.xml +++ b/build.xml @@ -95,7 +95,6 @@ <target name="jar-javadoc" depends="javadoc"> - <mkdir dir="${basedir}/dist/javadoc"/> <jar destfile="${basedir}/dist/open-dis7-javadoc.jar" basedir="${basedir}/dist/javadoc"> <manifest> <attribute name="Built-By" value="open-dis-7-java"/> @@ -107,7 +106,6 @@ <attribute name="Implementation-Vendor" value="Naval Postgraduate School"/> </manifest> </jar> - <delete dir="${basedir}/dist/javadoc"/> </target> <target name="jar-source"> diff --git a/dist/open-dis7-javadoc.jar b/dist/open-dis7-javadoc.jar index 8769f49bf0e5ceb60ecc06b23eace11e5fc0f197..ba7765ea598664deff2306176d078fb3e57f3b32 100644 Binary files a/dist/open-dis7-javadoc.jar and b/dist/open-dis7-javadoc.jar differ diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index b10a0bd81c0992315837b5b4e3fb3f669ebc0557..ad77865ed2742a629bc2ab594114577f8960ba78 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -119,43 +119,7 @@ is divided into following sections: <property name="module.name" value=""/> </target> <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init"> - <j2seproject1:property name="platform.home" value="platforms.${platform.active}.home"/> - <j2seproject1:property name="platform.bootcp" value="platforms.${platform.active}.bootclasspath"/> - <j2seproject1:property name="platform.compiler" value="platforms.${platform.active}.compile"/> - <j2seproject1:property name="platform.javac.tmp" value="platforms.${platform.active}.javac"/> - <condition property="platform.javac" value="${platform.home}/bin/javac"> - <equals arg1="${platform.javac.tmp}" arg2="$${platforms.${platform.active}.javac}"/> - </condition> - <property name="platform.javac" value="${platform.javac.tmp}"/> - <j2seproject1:property name="platform.java.tmp" value="platforms.${platform.active}.java"/> - <condition property="platform.java" value="${platform.home}/bin/java"> - <equals arg1="${platform.java.tmp}" arg2="$${platforms.${platform.active}.java}"/> - </condition> - <property name="platform.java" value="${platform.java.tmp}"/> - <j2seproject1:property name="platform.javadoc.tmp" value="platforms.${platform.active}.javadoc"/> - <condition property="platform.javadoc" value="${platform.home}/bin/javadoc"> - <equals arg1="${platform.javadoc.tmp}" arg2="$${platforms.${platform.active}.javadoc}"/> - </condition> - <property name="platform.javadoc" value="${platform.javadoc.tmp}"/> - <condition property="platform.invalid" value="true"> - <or> - <contains string="${platform.javac}" substring="$${platforms."/> - <contains string="${platform.java}" substring="$${platforms."/> - <contains string="${platform.javadoc}" substring="$${platforms."/> - </or> - </condition> - <fail unless="platform.home">Must set platform.home</fail> - <fail unless="platform.bootcp">Must set platform.bootcp</fail> - <fail unless="platform.java">Must set platform.java</fail> - <fail unless="platform.javac">Must set platform.javac</fail> - <fail if="platform.invalid"> - The J2SE Platform is not correctly set up. - Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. - Either open the project in the IDE and setup the Platform with the same name or add it manually. - For example like this: - ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file) - or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used) - </fail> + <property name="platform.java" value="${java.home}/bin/java"/> <available file="${manifest.file}" property="manifest.available"/> <condition property="splashscreen.available"> <and> @@ -291,6 +255,20 @@ is divided into following sections: <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}"> <isset property="profile.available"/> </condition> + <condition else="false" property="jdkBug6558476"> + <and> + <matches pattern="1\.[56]" string="${java.specification.version}"/> + <not> + <os family="unix"/> + </not> + </and> + </condition> + <condition else="false" property="javac.fork"> + <or> + <istrue value="${jdkBug6558476}"/> + <istrue value="${javac.external.vm}"/> + </or> + </condition> <property name="jar.index" value="false"/> <property name="jar.index.metainf" value="${jar.index}"/> <property name="copylibs.rebase" value="true"/> @@ -379,7 +357,7 @@ is divided into following sections: </path> </resourcecount> </condition> - <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> <src> <dirset dir="@{gensrcdir}" erroronmissingdir="false"> <include name="*"/> @@ -430,7 +408,7 @@ is divided into following sections: <property location="${build.dir}/empty" name="empty.dir"/> <mkdir dir="${empty.dir}"/> <mkdir dir="@{apgeneratedsrcdir}"/> - <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> <src> <dirset dir="@{gensrcdir}" erroronmissingdir="false"> <include name="*"/> @@ -472,7 +450,7 @@ is divided into following sections: <sequential> <property location="${build.dir}/empty" name="empty.dir"/> <mkdir dir="${empty.dir}"/> - <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> <src> <dirset dir="@{gensrcdir}" erroronmissingdir="false"> <include name="*"/> @@ -551,7 +529,7 @@ is divided into following sections: <element name="customizePrototype" optional="true"/> <sequential> <property name="junit.forkmode" value="perTest"/> - <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}"> + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> <syspropertyset> <propertyref prefix="test-sys-prop."/> <mapper from="test-sys-prop.*" to="*" type="glob"/> @@ -579,7 +557,7 @@ is divided into following sections: <element name="customizePrototype" optional="true"/> <sequential> <property name="junit.forkmode" value="perTest"/> - <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}"> + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> <syspropertyset> <propertyref prefix="test-sys-prop."/> <mapper from="test-sys-prop.*" to="*" type="glob"/> @@ -655,7 +633,7 @@ is divided into following sections: </fileset> </union> <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/> - <testng classfilesetref="test.set" failureProperty="tests.failed" jvm="${platform.java}" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="open-dis7-java" testname="TestNG tests" workingDir="${work.dir}"> + <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="open-dis7-java" testname="TestNG tests" workingDir="${work.dir}"> <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/> <propertyset> <propertyref prefix="test-sys-prop."/> @@ -886,9 +864,6 @@ is divided into following sections: <classpath> <path path="@{classpath}"/> </classpath> - <bootclasspath> - <path path="${platform.bootcp}"/> - </bootclasspath> </nbjpdastart> </sequential> </macrodef> @@ -938,7 +913,7 @@ is divided into following sections: <attribute default="jvm" name="jvm"/> <element name="customize" optional="true"/> <sequential> - <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}" module="@{modulename}"> + <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}"> <classpath> <path path="@{classpath}"/> </classpath> @@ -972,7 +947,7 @@ is divided into following sections: <attribute default="jvm" name="jvm"/> <element name="customize" optional="true"/> <sequential> - <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}"> + <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true"> <classpath> <path path="@{classpath}"/> </classpath> @@ -1004,7 +979,7 @@ is divided into following sections: <attribute default="jvm" name="jvm"/> <element name="customize" optional="true"/> <sequential> - <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" jvm="${platform.java}"> + <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true"> <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> @@ -1225,7 +1200,7 @@ is divided into following sections: <j2seproject3:copylibs manifest="${tmp.manifest.file}"/> <echo level="info">To run this application from the command line without Ant, try:</echo> <property location="${dist.jar}" name="dist.jar.resolved"/> - <echo level="info">${platform.java} -jar "${dist.jar.resolved}"</echo> + <echo level="info">java -jar "${dist.jar.resolved}"</echo> </target> <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist"> <j2seproject1:jar manifest="${tmp.manifest.file}"/> @@ -1327,8 +1302,8 @@ is divided into following sections: <isset property="main.class.available"/> </and> </condition> - <property name="platform.jlink" value="${platform.home}/bin/jlink"/> - <property name="jlink.systemmodules.internal" value="${platform.home}/jmods"/> + <property name="platform.jlink" value="${jdk.home}/bin/jlink"/> + <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/> <exec executable="${platform.jlink}"> <arg value="--module-path"/> <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/> @@ -1521,19 +1496,16 @@ is divided into following sections: </not> </and> </condition> - <exec executable="${platform.java}" failonerror="false" outputproperty="platform.version.output"> - <arg value="-version"/> - </exec> <condition else="" property="bug5101868workaround" value="*.java"> - <matches multiline="true" pattern="1\.[56](\..*)?" string="${platform.version.output}"/> + <matches pattern="1\.[56](\..*)?" string="${java.version}"/> </condition> <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5"> <and> <isset property="javadoc.html5"/> - <available file="${platform.home}${file.separator}lib${file.separator}jrt-fs.jar"/> + <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/> </and> </condition> - <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" executable="${platform.javadoc}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> + <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> <classpath> <path path="${javac.classpath}"/> </classpath> diff --git a/src/edu/nps/moves/dis7/util/PduFactory.java b/src/edu/nps/moves/dis7/util/PduFactory.java index 5ed0a858b5530d8dd6cac7447f7a5a78c40faa08..dcc18adb66e9159248bad775eda693fb494ebd56 100644 --- a/src/edu/nps/moves/dis7/util/PduFactory.java +++ b/src/edu/nps/moves/dis7/util/PduFactory.java @@ -50,7 +50,14 @@ public class PduFactory } /** - * Create a PduFactory using the specified for country, exerciseId, application and timestamp format. + * Create a PduFactory which creates pdus using the specified default values. + * @param country used in EntityType and RadioType objects + * @param exerciseId used in standard Pdu header + * @param siteId used in standard Pdu header + * @param applicationId used instandard Pdu header + * @param useAbsoluteTimestamp boolean to specify absolute time stamps (IEEE Std 1278.1-2012, 4.6) + * @see edu.nps.moves.dis7.EntityType + * @see edu.nps.moves.dis7.RadioType */ public PduFactory(Country country, byte exerciseId, short siteId, short applicationId, boolean useAbsoluteTimestamp) { @@ -209,7 +216,7 @@ public class PduFactory /** * Create an Entity State PDU<br> * IEEE Std 1278.1-2012, 5.3.2 - * @return pdu + * @return the pdu */ public EntityStatePdu makeEntityStatePdu() { @@ -232,7 +239,7 @@ public class PduFactory /** * Create a Fire PDU<br> * IEEE Std 1278.1-2012, 5.4.3 - * @return pdu + * @return the pdu */ public FirePdu makeFirePdu() { @@ -251,7 +258,7 @@ public class PduFactory /** * Create a Detonation PDU<br> * IEEE Std 1278.1-2012, 5.4.4 - * @return pdu + * @return the pdu */ public DetonationPdu makeDetonationPdu() { @@ -267,7 +274,7 @@ public class PduFactory /** * Create a Collision PDU<br> * IEEE Std 1278.1-2012, 5.3.3 - * @return pdu + * @return the pdu */ public CollisionPdu makeCollisionPdu() { @@ -286,7 +293,7 @@ public class PduFactory /** * Create a Service Request PDU<br> * IEEE Std 1278.1-2012, 5.5.5 - * @return pdu + * @return the pdu */ public ServiceRequestPdu makeServiceRequestPdu() { @@ -303,7 +310,7 @@ public class PduFactory /** * Create a Resupply Offer PDU<br> * IEEE Std 1278.1-2012, 5.5.6 - * @return pdu + * @return the pdu */ public ResupplyOfferPdu makeResupplyOfferPdu() { @@ -317,7 +324,7 @@ public class PduFactory /** * Create a Resupply Received PDU<br> * IEEE Std 1278.1-2012, 5.5.7 - * @return pdu + * @return the pdu */ public ResupplyReceivedPdu makeResupplyReceivedPdu() { @@ -331,7 +338,7 @@ public class PduFactory /** * Create a Resupply Cancel PDU<br> * IEEE Std 1278.1-2012, 5.5.8 - * @return pdu + * @return the pdu */ public ResupplyCancelPdu makeResupplyCancelPdu() { @@ -345,7 +352,7 @@ public class PduFactory /** * Create a Repair Complete PDU<br> * IEEE Std 1278.1-2012, 5.5.10 - * @return pdu + * @return the pdu */ public RepairCompletePdu makeRepairCompletePdu() { @@ -362,7 +369,7 @@ public class PduFactory /** * Create a Repair Response PDU<br> * IEEE Std 1278.1-2012, 5.5.11 - * @return pdu + * @return the pdu */ public RepairResponsePdu makeRepairResponsePdu() { @@ -379,7 +386,7 @@ public class PduFactory /** * Create a Create Entity PDU<br> * IEEE Std 1278.1-2012, 5.6.5.2 - * @return pdu + * @return the pdu */ public CreateEntityPdu makeCreateEntityPdu() { @@ -391,7 +398,7 @@ public class PduFactory /** * Create a Remove Entity PDU<br> * IEEE Std 1278.1-2012, 5.6.5.3 - * @return pdu + * @return the pdu */ public RemoveEntityPdu makeRemoveEntityPdu() { @@ -405,7 +412,7 @@ public class PduFactory /** * Create a Start Resume PDU<br> * IEEE Std 1278.1-2012, 5.6.5.4 - * @return pdu + * @return the pdu */ public StartResumePdu makeStartResumePdu() { @@ -417,7 +424,7 @@ public class PduFactory /** * Create a Stop Freeze PDU<br> * IEEE Std 1278.1-2012, 5.6.5.5 - * @return pdu + * @return the pdu */ public StopFreezePdu makeStopFreezePdu() { @@ -433,7 +440,7 @@ public class PduFactory /** * Create an Acknowledge PDU<br> * IEEE Std 1278.1-2012, 5.6.5.6 - * @return pdu + * @return the pdu */ public AcknowledgePdu makeAcknowledgePdu() { @@ -450,7 +457,7 @@ public class PduFactory /** * Create an Action Request PDU<br> * IEEE Std 1278.1-2012, 5.6.5.7 - * @return pdu + * @return the pdu */ public ActionRequestPdu makeActionRequestPdu() { @@ -464,7 +471,7 @@ public class PduFactory /** * Create an Action Response PDU<br> * IEEE Std 1278.1-2012, 5.6.5.8 - * @return pdu + * @return the pdu */ public ActionResponsePdu makeActionResponsePdu() { @@ -478,7 +485,7 @@ public class PduFactory /** * Create a Data Query PDU<br> * IEEE Std 1278.1-2012, 5.6.5.9 - * @return pdu + * @return the pdu */ public DataQueryPdu makeDataQueryPdu() { @@ -490,7 +497,7 @@ public class PduFactory /** * Create a Set DataPDU<br> * IEEE Std 1278.1-2012, 5.6.5.10 - * @return pdu + * @return the pdu */ public SetDataPdu makeSetDataPdu() { @@ -502,7 +509,7 @@ public class PduFactory /** * Create a Data PDU<br> * IEEE Std 1278.1-2012, 5.6.5.11 - * @return pdu + * @return the pdu */ public DataPdu makeDataPdu() { @@ -514,7 +521,7 @@ public class PduFactory /** * Create an Event Report PDU<br> * IEEE Std 1278.1-2012, 5.6.5.12 - * @return pdu + * @return the pdu */ public EventReportPdu makeEventReportPdu() { @@ -528,7 +535,7 @@ public class PduFactory /** * Create a Comment PDU<br> * IEEE Std 1278.1-2012, 5.6.5.13 - * @return pdu + * @return the pdu */ public CommentPdu makeCommentPdu() { @@ -570,7 +577,7 @@ public class PduFactory /** * Create a Electromagnetic Emission (EE) PDU<br> * IEEE Std 1278.1-2012, 5.7.3 - * @return pdu + * @return the pdu */ public ElectromagneticEmissionPdu makeElectronicEmissionsPdu() { @@ -583,6 +590,11 @@ public class PduFactory return (ElectromagneticEmissionPdu) addBoilerPlate(pdu); } + /** + * Create a Designator PDU<br> + * IEEE Std 1278.1-2012, 5.7.4 + * @return the pdu + */ public DesignatorPdu makeDesignatorPdu() { DesignatorPdu pdu = new DesignatorPdu() @@ -599,6 +611,11 @@ public class PduFactory return (DesignatorPdu) addBoilerPlate(pdu); } + /** + * Create a Transmitter PDU<br> + * IEEE Std 1278.1-2012, 5.8.3 + * @return the pdu + */ public TransmitterPdu makeTransmitterPdu() { TransmitterPdu pdu = new TransmitterPdu() @@ -616,6 +633,11 @@ public class PduFactory return (TransmitterPdu) addBoilerPlate(pdu); } + /** + * Create a Signal PDU<br> + * IEEE Std 1278.1-2012, 5.7.4 + * @return the pdu + */ public SignalPdu makeSignalPdu() { SignalPdu pdu = new SignalPdu() @@ -626,6 +648,11 @@ public class PduFactory return (SignalPdu) addBoilerPlate(pdu); } + /** + * Create a Receiver PDU<br> + * IEEE Std 1278.1-2012, 5.8.5 + * @return the pdu + */ public ReceiverPdu makeReceiverPdu() { ReceiverPdu pdu = new ReceiverPdu() @@ -637,6 +664,11 @@ public class PduFactory return (ReceiverPdu) addBoilerPlate(pdu); } + /** + * Create a an Identification Friend or Foe (IFF) PDU<br> + * IEEE Std 1278.1-2012, 5.7.6 + * @return the pdu + */ public IFFPdu makeIffPdu() { IFFPdu pdu = new IFFPdu() @@ -651,6 +683,11 @@ public class PduFactory return (IFFPdu) addBoilerPlate(pdu); } + /** + * Create a Designator PDU<br> + * IEEE Std 1278.1-2012, 5.7.4 + * @return the pdu + */ public UnderwaterAcousticPdu makeUnderwaterAcousticPdu() { UnderwaterAcousticPdu pdu = new UnderwaterAcousticPdu() @@ -663,6 +700,11 @@ public class PduFactory return (UnderwaterAcousticPdu) addBoilerPlate(pdu); } + /** + * Create a Supplemental Emission/Entity State (SEES) PDU<br> + * IEEE Std 1278.1-2012, 5.7.7 + * @return the pdu + */ public SEESPdu makeSeesPdu() { SEESPdu pdu = new SEESPdu(); @@ -670,6 +712,11 @@ public class PduFactory return (SEESPdu) addBoilerPlate(pdu); } + /** + * Create an Intercom Signal PDU<br> + * IEEE Std 1278.1-2012, 5.8.6 + * @return the pdu + */ public IntercomSignalPdu makeIntercomSignalPdu() { IntercomSignalPdu pdu = new IntercomSignalPdu(); @@ -677,6 +724,11 @@ public class PduFactory return (IntercomSignalPdu) addBoilerPlate(pdu); } + /** + * Create an Intercom Control PDU<br> + * IEEE Std 1278.1-2012, 5.8.7 + * @return the pdu + */ public IntercomControlPdu makeIntercomControlPdu() { IntercomControlPdu pdu = new IntercomControlPdu() @@ -689,6 +741,11 @@ public class PduFactory return (IntercomControlPdu) addBoilerPlate(pdu); } + /** + * Create a Designator PDU<br> + * IEEE Std 1278.1-2012, 5.7.4 + * @return the pdu + */ public AggregateStatePdu makeAggregateStatePdu() { AggregateStatePdu pdu = new AggregateStatePdu(); @@ -702,6 +759,11 @@ public class PduFactory return (AggregateStatePdu) addBoilerPlate(pdu); } + /** + * Create an IsGroupOf PDU<br> + * IEEE Std 1278.1-2012, 5.9.3 + * @return the pdu + */ public IsGroupOfPdu makeIsGroupOfPdu() { IsGroupOfPdu pdu = new IsGroupOfPdu() @@ -712,6 +774,11 @@ public class PduFactory return (IsGroupOfPdu) addBoilerPlate(pdu); } + /** + * Create a Transfer Ownership PDU<br> + * IEEE Std 1278.1-2012, 5.9.4 + * @return the pdu + */ public TransferOwnershipPdu makeTransferOwnershipPdu() { TransferOwnershipPdu pdu = new TransferOwnershipPdu() @@ -726,6 +793,11 @@ public class PduFactory return (TransferOwnershipPdu) addBoilerPlate(pdu); } + /** + * Create an IsPartOf PDU<br> + * IEEE Std 1278.1-2012, 5.9.5 + * @return the pdu + */ public IsPartOfPdu makeIsPartOfPdu() { IsPartOfPdu pdu = new IsPartOfPdu() @@ -740,6 +812,11 @@ public class PduFactory return (IsPartOfPdu) addBoilerPlate(pdu); } + /** + * Create a Minefield State PDU<br> + * IEEE Std 1278.1-2012, 5.10.2 + * @return the pdu + */ public MinefieldStatePdu makeMinefieldStatePdu() { MinefieldStatePdu pdu = new MinefieldStatePdu(); @@ -755,6 +832,11 @@ public class PduFactory return (MinefieldStatePdu) addBoilerPlate(pdu); } + /** + * Create a Minefield Query PDU<br> + * IEEE Std 1278.1-2012, 5.10.3 + * @return the pdu + */ public MinefieldQueryPdu makeMinefieldQueryPdu() { MinefieldQueryPdu pdu = new MinefieldQueryPdu() @@ -767,6 +849,11 @@ public class PduFactory return (MinefieldQueryPdu) addBoilerPlate(pdu); } + /** + * Create a Minefield Data PDU<br> + * IEEE Std 1278.1-2012, 5.10.4 + * @return the pdu + */ public MinefieldDataPdu makeMinefieldDataPdu() { MinefieldDataPdu pdu = new MinefieldDataPdu() @@ -782,6 +869,11 @@ public class PduFactory return (MinefieldDataPdu) addBoilerPlate(pdu); } + /** + * Create a Minefield Response Negative Acknowledgment (NACK) PDU<br> + * IEEE Std 1278.1-2012, 5.10.5 + * @return the pdu + */ public MinefieldResponseNACKPdu makeMinefieldResponseNackPdu() { MinefieldResponseNACKPdu pdu = new MinefieldResponseNACKPdu(); @@ -789,6 +881,11 @@ public class PduFactory return (MinefieldResponseNACKPdu) addBoilerPlate(pdu); } + /** + * Create an Environmental Process PDU<br> + * IEEE Std 1278.1-2012, 5.11.2.2 + * @return the pdu + */ public EnvironmentalProcessPdu makeEnvironmentalProcessPdu() { EnvironmentalProcessPdu pdu = new EnvironmentalProcessPdu() @@ -801,6 +898,11 @@ public class PduFactory return (EnvironmentalProcessPdu) addBoilerPlate(pdu); } + /** + * Create a Gridded Data PDU<br> + * IEEE Std 1278.1-2012, 5.11.2.3 + * @return the pdu + */ public GriddedDataPdu makeGriddedDataPdu() { GriddedDataPdu pdu = new GriddedDataPdu() @@ -815,6 +917,11 @@ public class PduFactory return (GriddedDataPdu) addBoilerPlate(pdu); } + /** + * Create a Point Object State PDU<br> + * IEEE Std 1278.1-2012, 5.11.3.2 + * @return the pdu + */ public PointObjectStatePdu makePointObjectStatePdu() { PointObjectStatePdu pdu = new PointObjectStatePdu() @@ -831,6 +938,11 @@ public class PduFactory return (PointObjectStatePdu) addBoilerPlate(pdu); } + /** + * Create a Linear Object State PDU<br> + * IEEE Std 1278.1-2012, 5.11.3.3 + * @return the pdu + */ public LinearObjectStatePdu makeLinearObjectStatePdu() { LinearObjectStatePdu pdu = new LinearObjectStatePdu() @@ -845,6 +957,11 @@ public class PduFactory return (LinearObjectStatePdu) addBoilerPlate(pdu); } + /** + * Create an Areal Object State PDU<br> + * IEEE Std 1278.1-2012, 5.11.3.4 + * @return the pdu + */ public ArealObjectStatePdu makeArealObjectStatePdu() { ArealObjectStatePdu pdu = new ArealObjectStatePdu() @@ -857,6 +974,11 @@ public class PduFactory return (ArealObjectStatePdu) addBoilerPlate(pdu); } + /** + * Create a Time Space Position Information (TSPI) PDU<br> + * IEEE Std 1278.1-2012, 9.4.2 + * @return the pdu + */ public TSPIPdu makeTspiPdu() { TSPIPdu pdu = new TSPIPdu() @@ -872,6 +994,11 @@ public class PduFactory return (TSPIPdu) addBoilerPlate(pdu); } + /** + * Create an Appearance PDU<br> + * IEEE Std 1278.1-2012, 9.4.3 + * @return the pdu + */ public AppearancePdu makeAppearancePdu() { AppearancePdu pdu = new AppearancePdu() @@ -887,6 +1014,11 @@ public class PduFactory return (AppearancePdu) addBoilerPlate(pdu); } + /** + * Create an Articulated Parts PDU<br> + * IEEE Std 1278.1-2012, 9.4.4 + * @return the pdu + */ public ArticulatedPartsPdu makeArticulatedPartsPdu() { ArticulatedPartsPdu pdu = new ArticulatedPartsPdu() @@ -895,6 +1027,11 @@ public class PduFactory return (ArticulatedPartsPdu) addBoilerPlate(pdu); } + /** + * Create a Live Entity (LE) Fire PDU<br> + * IEEE Std 1278.1-2012, 9.4.5 + * @return the pdu + */ public LEFirePdu makeLEFirePdu() { LEFirePdu pdu = new LEFirePdu() @@ -911,6 +1048,11 @@ public class PduFactory return (LEFirePdu) addBoilerPlate(pdu); } + /** + * Create a Live Entity (LE) Detonation PDU<br> + * IEEE Std 1278.1-2012, 9.4.6 + * @return the pdu + */ public LEDetonationPdu makeLEDetonationPdu() { LEDetonationPdu pdu = new LEDetonationPdu() @@ -929,6 +1071,11 @@ public class PduFactory return (LEDetonationPdu) addBoilerPlate(pdu); } + /** + * Create a Create Entity-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.2 + * @return the pdu + */ public CreateEntityReliablePdu makeCreateEntityReliablePdu() { CreateEntityReliablePdu pdu = new CreateEntityReliablePdu(); @@ -940,6 +1087,11 @@ public class PduFactory return (CreateEntityReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Remove Entity-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.3 + * @return the pdu + */ public RemoveEntityReliablePdu makeRemoveEntityReliablePdu() { RemoveEntityReliablePdu pdu = new RemoveEntityReliablePdu(); @@ -949,6 +1101,11 @@ public class PduFactory return (RemoveEntityReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Start/Resume-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.4 + * @return the pdu + */ public StartResumeReliablePdu makeStartResumeReliablePdu() { StartResumeReliablePdu pdu = new StartResumeReliablePdu(); @@ -960,6 +1117,11 @@ public class PduFactory return (StartResumeReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Stop/Freeze-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.5 + * @return the pdu + */ public StopFreezeReliablePdu makeStopFreezeReliablePdu() { StopFreezeReliablePdu pdu = new StopFreezeReliablePdu(); @@ -972,6 +1134,11 @@ public class PduFactory return (StopFreezeReliablePdu) addBoilerPlate(pdu); } + /** + * Create an Acknowledge-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.6 + * @return the pdu + */ public AcknowledgeReliablePdu makeAcknowledgeReliablePdu() { AcknowledgeReliablePdu pdu = new AcknowledgeReliablePdu(); @@ -984,6 +1151,11 @@ public class PduFactory return (AcknowledgeReliablePdu) addBoilerPlate(pdu); } + /** + * Create an Action Request-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.7 + * @return the pdu + */ public ActionRequestReliablePdu makeActionRequestReliablePdu() { ActionRequestReliablePdu pdu = new ActionRequestReliablePdu(); @@ -994,6 +1166,11 @@ public class PduFactory return (ActionRequestReliablePdu) addBoilerPlate(pdu); } + /** + * Create an Action Response-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.8 + * @return the pdu + */ public ActionResponseReliablePdu makeActionResponseReliablePdu() { ActionResponseReliablePdu pdu = new ActionResponseReliablePdu(); @@ -1003,6 +1180,11 @@ public class PduFactory return (ActionResponseReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Data Query-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.9 + * @return the pdu + */ public DataQueryReliablePdu makeDataQueryReliablePdu() { DataQueryReliablePdu pdu = new DataQueryReliablePdu(); @@ -1014,6 +1196,11 @@ public class PduFactory return (DataQueryReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Set Data-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.10 + * @return the pdu + */ public SetDataReliablePdu makeSetDataReliablePdu() { SetDataReliablePdu pdu = new SetDataReliablePdu(); @@ -1025,6 +1212,11 @@ public class PduFactory return (SetDataReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Data-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.11 + * @return the pdu + */ public DataReliablePdu makeDataReliablePdu() { DataReliablePdu pdu = new DataReliablePdu(); @@ -1036,6 +1228,11 @@ public class PduFactory return (DataReliablePdu) addBoilerPlate(pdu); } + /** + * Create an Event Report-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.12 + * @return the pdu + */ public EventReportReliablePdu makeEventReportReliablePdu() { EventReportReliablePdu pdu = new EventReportReliablePdu(); @@ -1045,6 +1242,11 @@ public class PduFactory return (EventReportReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Comment-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.13 + * @return the pdu + */ public CommentReliablePdu makeCommentReliablePdu() { CommentReliablePdu pdu = new CommentReliablePdu(); @@ -1053,7 +1255,7 @@ public class PduFactory } /** - * Create a CommentR PDU containing the given String(s), variable record type = "OTHER" + * Create a Comment-R PDU containing the given String(s), variable record type = "OTHER" * @param comments * @return the pdu */ @@ -1082,7 +1284,11 @@ public class PduFactory return pdu; } - + /** + * Create a Record-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.16 + * @return the pdu + */ public RecordReliablePdu makeRecordReliablePdu() { RecordReliablePdu pdu = new RecordReliablePdu(); @@ -1093,6 +1299,11 @@ public class PduFactory return (RecordReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Set Record-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.15 + * @return the pdu + */ public SetRecordReliablePdu makeSetRecordReliablePdu() { SetRecordReliablePdu pdu = new SetRecordReliablePdu(); @@ -1102,6 +1313,11 @@ public class PduFactory return (SetRecordReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Record Query-R (Reliable) PDU<br> + * IEEE Std 1278.1-2012, 5.12.4.14 + * @return the pdu + */ public RecordQueryReliablePdu makeRecordQueryReliablePdu() { RecordQueryReliablePdu pdu = new RecordQueryReliablePdu(); @@ -1112,12 +1328,22 @@ public class PduFactory return (RecordQueryReliablePdu) addBoilerPlate(pdu); } + /** + * Create a Collision-Elastic PDU<br> + * IEEE Std 1278.1-2012, 5.3.4 + * @return the pdu + */ public CollisionElasticPdu makeCollisionElasticPdu() { CollisionElasticPdu pdu = new CollisionElasticPdu(); return (CollisionElasticPdu) addBoilerPlate(pdu); } + /** + * Create a Entity State Update PDU<br> + * IEEE Std 1278.1-2012, 5.3.5 + * @return the pdu + */ public EntityStateUpdatePdu makeEntityStateUpdatePdu() { EntityStateUpdatePdu pdu = new EntityStateUpdatePdu() @@ -1130,6 +1356,11 @@ public class PduFactory return (EntityStateUpdatePdu) addBoilerPlate(pdu); } + /** + * Create a Directed Energy (DE) Fire PDU<br> + * IEEE Std 1278.1-2012, 5.4.5 + * @return the pdu + */ public DirectedEnergyFirePdu makeDirectedEnergyFirePdu() { DirectedEnergyFirePdu pdu = new DirectedEnergyFirePdu() @@ -1144,12 +1375,22 @@ public class PduFactory return (DirectedEnergyFirePdu) addBoilerPlate(pdu); } + /** + * Create a Collision-Elastic PDU<br> + * IEEE Std 1278.1-2012, 5.3.3 + * @return the pdu + */ public EntityDamageStatusPdu makeEntityDamageStatusPdu() { EntityDamageStatusPdu pdu = new EntityDamageStatusPdu(); return (EntityDamageStatusPdu) addBoilerPlate(pdu); } + /** + * Create an Information Operations (IO) Action PDU<br> + * IEEE Std 1278.1-2012, 5.13.3 + * @return the pdu + */ public InformationOperationsActionPdu makeInformationOperationsActionPdu() { InformationOperationsActionPdu pdu = new InformationOperationsActionPdu() @@ -1165,6 +1406,11 @@ public class PduFactory return (InformationOperationsActionPdu) addBoilerPlate(pdu); } + /** + * Create an Information Operations (IO) Report PDU<br> + * IEEE Std 1278.1-2012, 5.13.4 + * @return the pdu + */ public InformationOperationsReportPdu makeInformationOperationsReportPdu() { InformationOperationsReportPdu pdu = new InformationOperationsReportPdu() @@ -1179,6 +1425,11 @@ public class PduFactory return (InformationOperationsReportPdu) addBoilerPlate(pdu); } + /** + * Create an Attribute PDU<br> + * IEEE Std 1278.1-2012, 5.3.6 + * @return the pdu + */ public AttributePdu makeAttributePdu() { AttributePdu pdu = new AttributePdu() @@ -1194,11 +1445,11 @@ public class PduFactory } /** - * PDU factory. Pass in an array of bytes, get the correct type of pdu back, + * PDU builder. Pass in an array of bytes, get the correct type of pdu back, * based on the PDU type field contained in the byte array. * * @param data - * @return A PDU of the appropriate concrete subclass of PDU + * @return A PDU of the appropriate concrete subclass of PDU or null if there was an error */ public Pdu createPdu(byte data[]) { @@ -1206,11 +1457,11 @@ public class PduFactory } /** - * PDU factory. Pass in an array of bytes, get the correct type of pdu back, + * PDU builder. Pass in an array of bytes, get the correct type of pdu back, * based on the PDU type field contained in the byte buffer. * * @param buff - * @return null if there was an error creating the Pdu + * @return the pdu or null if there was an error creating the Pdu */ public Pdu createPdu(java.nio.ByteBuffer buff) { @@ -1227,11 +1478,21 @@ public class PduFactory return createPdu(pduType, buff); } + /** + * Create an empty PDU of the given type + * @param pduType + * @return the pdu + */ public Pdu createPdu(DISPDUType pduType) { return createPdu(pduType, null); } + /** + * Return the enumerated pdu type from a byte array, typically received from the network + * @param ba byte array + * @return the type + */ public DISPDUType getTypeFromByteArray(byte[] ba) { return DISPDUType.getEnumForValue(Byte.toUnsignedInt(ba[2])); // 3rd byte