Package edu.nps.moves.dis7.pdus
Class CollisionPdu
java.lang.Object
edu.nps.moves.dis7.pdus.Pdu
edu.nps.moves.dis7.pdus.PduBase
edu.nps.moves.dis7.pdus.EntityInformationInteractionFamilyPdu
edu.nps.moves.dis7.pdus.CollisionPdu
- All Implemented Interfaces:
Marshaller,Serializable
7.2.3 Collisions between entities shall be communicated by issuing a Collision PDU. See 5.3.3.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteArrayOutputStreambyteArrayOutputStream (baos) is used for marshal/unmarshal serializationprotected EntityIDThis field shall identify the entity that has collided with the issuing entity (see 5.3.3.4).protected CollisionTypeThis field shall identify the type of collision.protected DataOutputStreamdataOutputStream (dos) is used for marshal/unmarshal serializationprotected EventIdentifierThis field shall contain an identification generated by the issuing simulation application to associate related collision events.protected EntityIDThis field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28).protected Vector3FloatThis field shall specify the location of the collision with respect to the entity with which the issuing entity collided.protected floatThis field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms.static final StringThe name of this PDU typeprotected bytesome paddingprotected Vector3FloatThis field shall contain the velocity (at the time the collision is detected) of the issuing entity.Fields inherited from class edu.nps.moves.dis7.pdus.EntityInformationInteractionFamilyPdu
FAMILY_NAMEFields inherited from class edu.nps.moves.dis7.pdus.Pdu
exerciseID, length, pduType, protocolFamily, protocolVersion, timestamp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy method creates a deep copy of current object using preferred marshalling methodCreates a "deep copy" of current object using ByteBuffer methods.copy method creates a deep copy of current object using DataOutputStream methods.booleanbooleanequalsImpl(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied objectGetter forcollidingEntityIDGetter forcollisionTypeGetter foreventIDGetter forissuingEntityIDGetter forlocationintReturns size of this serialized (marshalled) object in bytesfloatgetMass()Getter formassbytegetPad()Getter forpadGetter forvelocityinthashCode()voidmarshal(DataOutputStream dos) Serializes an object to a DataOutputStream.voidmarshal(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setCollidingEntityID(EntityID pCollidingEntityID) Setter forcollidingEntityIDsetCollisionType(CollisionType pCollisionType) Setter forcollisionTypesetEventID(EventIdentifier pEventID) Setter foreventIDsetIssuingEntityID(EntityID pIssuingEntityID) Setter forissuingEntityIDsetLocation(Vector3Float pLocation) Setter forlocationsetMass(float pMass) Setter formasssetPad(byte pPad) Setter forpadsetPad(int pPad) Utility setter forpadsetVelocity(Vector3Float pVelocity) Setter forvelocitytoString()intunmarshal(DataInputStream dis) Deserializes an object from a DataInputStream.intunmarshal(ByteBuffer byteBuffer) Unpacks a Pdu from the underlying data.Methods inherited from class edu.nps.moves.dis7.pdus.PduBase
getPadding, getPduStatus, setPadding, setPadding, setPduStatusMethods inherited from class edu.nps.moves.dis7.pdus.Pdu
copyByPduFactory, getExerciseID, getLength, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, getTimestampSeconds, isAcknowledgeRPdu, isActionRequestPdu, isActionRequestRPdu, isActionResponsePdu, isActionResponseRPdu, isAggregateStatePdu, isAppearancePdu, isArealObjectStatePdu, isArticulatedPartsPdu, isAttributePdu, isCollisionElasticPdu, isCollisionPdu, isCommentPdu, isCommentRPdu, isCreateEntityPdu, isCreateEntityRPdu, isDataPdu, isDataQueryPdu, isDataQueryRPdu, isDataRPdu, isDesignatorPdu, isDetonationPdu, isDirectedEnergyFirePdu, isDistributedEmissionsRegenerationFamilyPdu, isElectromagneticEmissionPdu, isEntityDamageStatusPdu, isEntityInformationInteractionFamilyPdu, isEntityManagementFamilyPdu, isEntityStatePdu, isEntityStateUpdatePdu, isEnvironmentalProcessPdu, isEventReportPdu, isEventReportRPdu, isFirePdu, isGriddedDataPdu, isIFFPdu, isInformationOperationsActionPdu, isInformationOperationsFamilyPdu, isInformationOperationsReportPdu, isIntercomControlPdu, isIntercomSignalPdu, isIsGroupOfPdu, isIsPartOfPdu, isLEDetonationPdu, isLEFirePdu, isLinearObjectStatePdu, isLiveEntityDetonationPdu, isLiveEntityFirePdu, isLogisticsFamilyPdu, isMinefieldDataPdu, isMinefieldFamilyPdu, isMinefieldQueryPdu, isMinefieldResponseNACKPdu, isMinefieldStatePdu, isPointObjectStatePdu, isRadioCommunicationsFamilyPdu, isReceiverPdu, isRecordQueryRPdu, isRecordRPdu, isReliablePdu, isRemoveEntityPdu, isRemoveEntityRPdu, isRepairCompletePdu, isRepairResponsePdu, isResupplyCancelPdu, isResupplyOfferPdu, isResupplyReceivedPdu, isSEESPdu, isSetDataPdu, isSetDataRPdu, isSetRecordRPdu, isSignalPdu, isSimulationManagementFamilyPdu, isSimulationManagementWithReliabilityFamilyPdu, isStartResumePdu, isStartResumeRPdu, isStopFreezePdu, isStopFreezeRPdu, isSupplementalEmissionEntityStatePdu, isSyntheticEnvironmentFamilyPdu, isTransferOwnershipPdu, isTransmitterPdu, isTSPIPdu, isUnderwaterAcousticPdu, isWarfareFamilyPdu, marshal, occursAfter, occursBefore, occursSameTime, setExerciseID, setExerciseID, setLength, setLength, setPduType, setProtocolFamily, setProtocolVersion, setTimestamp, setTimestampSeconds
-
Field Details
-
NAME
-
issuingEntityID
This field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28). -
collidingEntityID
This field shall identify the entity that has collided with the issuing entity (see 5.3.3.4). This field shall be represented by an Entity Identifier record (see 6.2.28). -
eventID
This field shall contain an identification generated by the issuing simulation application to associate related collision events. This field shall be represented by an Event Identifier record (see 6.2.34). -
collisionType
This field shall identify the type of collision. The Collision Type field shall be represented by an 8-bit record of enumerations uid 189 -
pad
protected byte padsome padding -
velocity
This field shall contain the velocity (at the time the collision is detected) of the issuing entity. The velocity shall be represented in world coordinates. This field shall be represented by the Linear Velocity Vector record [see 6.2.95 item c)]. -
mass
protected float massThis field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms. -
location
This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. The Location field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)]. -
byteArrayOutputStream
byteArrayOutputStream (baos) is used for marshal/unmarshal serialization- See Also:
-
dataOutputStream
dataOutputStream (dos) is used for marshal/unmarshal serialization- See Also:
-
-
Constructor Details
-
CollisionPdu
public CollisionPdu()Constructor creates and configures a new instance object
-
-
Method Details
-
copy
copy method creates a deep copy of current object using preferred marshalling method- Returns:
- deep copy of PDU
-
copyByteBuffer
Creates a "deep copy" of current object using ByteBuffer methods.- Returns:
- deep copy of PDU
-
copyDataOutputStream
copy method creates a deep copy of current object using DataOutputStream methods.- Returns:
- deep copy of PDU
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Specified by:
getMarshalledSizein interfaceMarshaller- Overrides:
getMarshalledSizein classEntityInformationInteractionFamilyPdu- Returns:
- serialized size in bytes
- See Also:
-
setIssuingEntityID
Setter forissuingEntityID- Parameters:
pIssuingEntityID- new value of interest- Returns:
- same object to permit progressive setters
-
getIssuingEntityID
-
setCollidingEntityID
Setter forcollidingEntityID- Parameters:
pCollidingEntityID- new value of interest- Returns:
- same object to permit progressive setters
-
getCollidingEntityID
-
setEventID
Setter foreventID- Parameters:
pEventID- new value of interest- Returns:
- same object to permit progressive setters
-
getEventID
-
setCollisionType
Setter forcollisionType- Parameters:
pCollisionType- new value of interest- Returns:
- same object to permit progressive setters
-
getCollisionType
-
setPad
Setter forpad- Parameters:
pPad- new value of interest- Returns:
- same object to permit progressive setters
-
setPad
Utility setter forpad- Parameters:
pPad- new value of interest- Returns:
- same object to permit progressive setters
-
getPad
-
setVelocity
Setter forvelocity- Parameters:
pVelocity- new value of interest- Returns:
- same object to permit progressive setters
-
getVelocity
-
setMass
Setter formass- Parameters:
pMass- new value of interest- Returns:
- same object to permit progressive setters
-
getMass
-
setLocation
Setter forlocation- Parameters:
pLocation- new value of interest- Returns:
- same object to permit progressive setters
-
getLocation
-
marshal
Serializes an object to a DataOutputStream.- Specified by:
marshalin interfaceMarshaller- Overrides:
marshalin classEntityInformationInteractionFamilyPdu- Parameters:
dos- the OutputStream- Throws:
Exception- if something goes wrong- See Also:
-
unmarshal
Deserializes an object from a DataInputStream.- Specified by:
unmarshalin interfaceMarshaller- Overrides:
unmarshalin classEntityInformationInteractionFamilyPdu- Parameters:
dis- the InputStream- Returns:
- marshalled serialized size in bytes
- Throws:
Exception- if something goes wrong- See Also:
-
marshal
Packs an object into the ByteBuffer.- Specified by:
marshalin interfaceMarshaller- Overrides:
marshalin classEntityInformationInteractionFamilyPdu- Parameters:
byteBuffer- The ByteBuffer at the position to begin writing- Throws:
BufferOverflowException- if byteBuffer is too smallReadOnlyBufferException- if byteBuffer is read onlyException- ByteBuffer-generated exception- See Also:
-
unmarshal
Unpacks a Pdu from the underlying data.- Specified by:
unmarshalin interfaceMarshaller- Overrides:
unmarshalin classEntityInformationInteractionFamilyPdu- Parameters:
byteBuffer- The ByteBuffer at the position to begin reading- Returns:
- marshalled serialized size in bytes
- Throws:
BufferUnderflowException- if byteBuffer is too smallException- ByteBuffer-generated exception- See Also:
-
equals
- Overrides:
equalsin classEntityInformationInteractionFamilyPdu
-
equalsImpl
Description copied from class:PduCompare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied object- Overrides:
equalsImplin classEntityInformationInteractionFamilyPdu- Parameters:
obj- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
- Overrides:
toStringin classEntityInformationInteractionFamilyPdu
-
hashCode
-