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 TypeMethodDescriptionboolean
boolean
equalsImpl
(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied objectGet description for this Domainint
Returns size of this serialized (marshalled) object in bytesint
getValue()
Get value for this Domainint
hashCode()
static Domain
MunitionDomain instance of intereststatic Domain
Domain of intereststatic Domain
inst
(SupplyDomain d) SupplyDomain instance of interestvoid
marshal
(DataOutputStream dos) Marshall this instance to DataOutputStreemvoid
marshal
(ByteBuffer byteBuffer) Marshall this instance to byteBuffertoString()
int
unmarshal
(DataInputStream dis) Deserializes an object from a DataInputStream.int
unmarshal
(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, forthis
and the supplied object- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
hashCode
-