Package edu.nps.moves.dis7.pdus
Class Domain
java.lang.Object
edu.nps.moves.dis7.pdus.Domain
Which domain does this PDU belong to:
An example approximating a Java enum "superclass". Can't use an interface, because we need the two
static methods, which can't go into an interface
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanequalsImpl(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthisand the supplied objectGet description for this DomainintReturns size of this serialized (marshalled) object in bytesintgetValue()Get value for this DomaininthashCode()static DomainMunitionDomain instance of intereststatic DomainDomain of intereststatic Domaininst(SupplyDomain d) SupplyDomain instance of interestvoidmarshal(DataOutputStream dos) Marshall this instance to DataOutputStreemvoidmarshal(ByteBuffer byteBuffer) Marshall this instance to byteBuffertoString()intunmarshal(DataInputStream dis) Deserializes an object from a DataInputStream.intunmarshal(ByteBuffer byteBuffer) Deserializes an object from a ByteBuffer.
-
Method Details
-
inst
Domain of interest- Parameters:
d- a PlatformDomain- Returns:
- an Domain instance based on a PlatformDomain enum
-
inst
MunitionDomain instance of interest- Parameters:
d- a MunitionDomain- Returns:
- an Domain instance based on a MunitionDomain enum
-
inst
SupplyDomain instance of interest- Parameters:
d- a SupplyDomain- Returns:
- an Domain instance based on a SupplyDomain enum
-
getValue
public int getValue()Get value for this Domain- Returns:
- value
-
getDescription
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Returns:
- serialized size in bytes
- See Also:
-
marshal
Marshall this instance to DataOutputStreem- Parameters:
dos- DataOutputStream
-
marshal
Marshall this instance to byteBuffer- Parameters:
byteBuffer- The ByteBuffer at the position to begin writing
-
unmarshal
Deserializes an object from a DataInputStream.- Parameters:
dis- DataInputStream- Returns:
- marshalled serialized size in bytes
- See Also:
-
unmarshal
Deserializes an object from a ByteBuffer.- Parameters:
byteBuffer- The ByteBuffer at the position to begin writing- Returns:
- marshalled serialized size in bytes
- See Also:
-
toString
-
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.
-
hashCode
-