Package edu.nps.moves.dis7.pdus
Class Sensor
java.lang.Object
edu.nps.moves.dis7.pdus.Sensor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected shortzero-filled array of padding bits for byte alignment and consistent sizing of PDU dataprotected shortquantity of the sensorprotected SensorOnOffStatusThe on/off status of the sensor uid 331protected shortfor Source 'other':SensorRecordOtherActiveSensors/325,'em':EmitterName/75,'passive':SensorRecordSensorTypePassiveSensors/326,'mine':6.2.57,'ua':UAAcousticSystemName/144,'lasers':DesignatorSystemName/80protected SensorTypeSourcethe source of the Sensor Type field uid 414protected intthe station to which the sensor is assigned. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanequalsImpl(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied objectintReturns size of this serialized (marshalled) object in bytesshortGetter forpaddingshortGetter forquantityGetter forsensorOnOffStatusshortGetter forsensorTypeGetter forsensorTypeSourceintGetter forstationinthashCode()voidmarshal(DataOutputStream dos) Serializes an object to a DataOutputStream.voidmarshal(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setPadding(int pPadding) Utility setter forpaddingsetPadding(short pPadding) Setter forpaddingsetQuantity(int pQuantity) Utility setter forquantitysetQuantity(short pQuantity) Setter forquantitysetSensorOnOffStatus(SensorOnOffStatus pSensorOnOffStatus) Setter forsensorOnOffStatussetSensorType(int pSensorType) Utility setter forsensorTypesetSensorType(short pSensorType) Setter forsensorTypesetSensorTypeSource(SensorTypeSource pSensorTypeSource) Setter forsensorTypeSourcesetStation(int pStation) Setter forstationtoString()intunmarshal(DataInputStream dis) Deserializes an object from a DataInputStream.intunmarshal(ByteBuffer byteBuffer) Unpacks a Pdu from the underlying data.
-
Field Details
-
sensorTypeSource
the source of the Sensor Type field uid 414 -
sensorOnOffStatus
The on/off status of the sensor uid 331 -
sensorType
protected short sensorTypefor Source 'other':SensorRecordOtherActiveSensors/325,'em':EmitterName/75,'passive':SensorRecordSensorTypePassiveSensors/326,'mine':6.2.57,'ua':UAAcousticSystemName/144,'lasers':DesignatorSystemName/80 -
station
protected int stationthe station to which the sensor is assigned. A zero value shall indi- cate that this Sensor record is not associated with any particular station and represents the total quan- tity of this sensor for this entity. If this field is non-zero, it shall either reference an attached part or an articulated part -
quantity
protected short quantityquantity of the sensor -
padding
protected short paddingzero-filled array of padding bits for byte alignment and consistent sizing of PDU data
-
-
Constructor Details
-
Sensor
public Sensor()Constructor creates and configures a new instance object
-
-
Method Details
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Returns:
- serialized size in bytes
- See Also:
-
setSensorTypeSource
Setter forsensorTypeSource- Parameters:
pSensorTypeSource- new value of interest- Returns:
- same object to permit progressive setters
-
getSensorTypeSource
Getter forsensorTypeSource- Returns:
- value of interest
-
setSensorOnOffStatus
Setter forsensorOnOffStatus- Parameters:
pSensorOnOffStatus- new value of interest- Returns:
- same object to permit progressive setters
-
getSensorOnOffStatus
Getter forsensorOnOffStatus- Returns:
- value of interest
-
setSensorType
Setter forsensorType- Parameters:
pSensorType- new value of interest- Returns:
- same object to permit progressive setters
-
setSensorType
Utility setter forsensorType- Parameters:
pSensorType- new value of interest- Returns:
- same object to permit progressive setters
-
getSensorType
-
setStation
-
getStation
-
setQuantity
-
setQuantity
-
getQuantity
-
setPadding
-
setPadding
-
getPadding
-
marshal
Serializes an object to a DataOutputStream.- Parameters:
dos- the OutputStream- Throws:
Exception- if something goes wrong- See Also:
-
unmarshal
Deserializes an object from a DataInputStream.- 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.- 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.- 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
-
equalsImpl
Compare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied object- Parameters:
obj- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
-
hashCode
-