mil.navy.nps.dis
Class EntityType

java.lang.Object
  extended bymil.navy.nps.dis.PduElement
      extended bymil.navy.nps.dis.EntityType
All Implemented Interfaces:
java.lang.Cloneable, SerializationInterface

public class EntityType
extends PduElement

Record providing full identification of entity type.

Version:
1.0
Author:
Don McGregor (http://www.npsnet.org/~mcgredo)
Location:
http://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/EntityType.java
~/mil/navy/nps/dis/EntityType.java
Hierarchy Diagram:
Summary:
This record shall specify the kind of entity, the country of design, the domain, the specific identification of the entity, and any extra information necessary for describing the entity.

Explanation:
The type of entity in a DIS exercise shall be specified by an Entity Type record. Fields not used shall contain the value zero.

History:
2Dec96 /Don McGregor /New
10Mar97 /Don McGregor /Cleaned up for javadoc
16Apr97 /Don McGregor /PrintStream passed to printValues
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
8Dec97 /Ronan Fauglas /changed entityKind to kind
References:
DIS Data Dictionary :Entity Type Record

DIS specification : IEEE 1278.1, 5.3.16
See Also:
PduElement

Field Summary
protected  UnsignedByte category
          This field shall specify the main category that describes the entity.
protected  UnsignedShort country
          This field shall specify the country to which the design of the entity is attributed.
protected  UnsignedByte domain
          This field shall specify the domain in which the equipment operates (for example, subsurface, surface, land, etc.) except for munition entities.
protected  UnsignedByte extra
          This field shall specify extra information required to describe a particular entity.
protected  UnsignedByte kind
          Entity kind: munition, life form, environmental...
static int sizeOf
          Constant value--size of an EntityType as written out to the wire.
protected  UnsignedByte specific
          This field shall specify specific information about an entity based upon the subcategory field to which it belongs.
protected  UnsignedByte subCategory
          This field shall specify a particular subcategory to which the entity belongs based on the category and the country.
 
Constructor Summary
EntityType()
          Default constructor--fills with zeros for all values.
 
Method Summary
 java.lang.Object clone()
          Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data.
 void deSerialize(java.io.DataInputStream inputStream)
          Deserialize our data from the input stream.
 UnsignedByte getCategory()
           
 UnsignedShort getCountry()
           
 UnsignedByte getDomain()
           
 UnsignedByte getExtra()
           
 UnsignedByte getKind()
           
 UnsignedByte getSpecific()
           
 UnsignedByte getSubCategory()
           
 int length()
          Returns the length of the object when serialized in a stream.
 void printValues(int indentLevel, java.io.PrintStream printStream)
          Prints the generated serialized object for debugging.
 void serialize(java.io.DataOutputStream outputStream)
          Serialize our data out to the stream.
 void setCategory(int pCategory)
           
 void setCategory(UnsignedByte pCategory)
           
 void setCountry(int pCountry)
           
 void setCountry(UnsignedShort pCountry)
           
 void setDomain(int pDomain)
           
 void setDomain(UnsignedByte pDomain)
           
 void setExtra(int pExtra)
           
 void setExtra(UnsignedByte pExtra)
           
 void setKind(int pKind)
           
 void setKind(UnsignedByte pKind)
           
 void setSpecific(int pSpecific)
           
 void setSpecific(UnsignedByte pSpecific)
           
 void setSubCategory(int pSubCategory)
           
 void setSubCategory(UnsignedByte pSubCategory)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kind

protected UnsignedByte kind
Entity kind: munition, life form, environmental... For now, entity kind is : 0-9
Value: Enumeration; see references below for information.
References:
DIS Data Dictionary: Entity Kind Field
see Section 4 in EBV-DOC


domain

protected UnsignedByte domain
This field shall specify the domain in which the equipment operates (for example, subsurface, surface, land, etc.) except for munition entities. For Munition entities this field shall specify the domain of the target (for example the munition might be surface-to-air, so the domain would be anti-air).
Value: Enumeration; see references below for information.
References:
DIS Data Dictionary: Entity Domain Field
see Section 4 in EBV-DOC


country

protected UnsignedShort country
This field shall specify the country to which the design of the entity is attributed. a 16 bits enumeration.
Value: Enumeration; see references below for information.
References:
DIS Data Dictionary: Country Field
See Section 4 in EBV-DOC


category

protected UnsignedByte category
This field shall specify the main category that describes the entity. The enumerations of category depend upon both the Kind and Domain.
Value: Enumeration; see references below for information.
References:
DIS Data Dictionary: Entity Category Field
See Section 4 in EBV-DOC


subCategory

protected UnsignedByte subCategory
This field shall specify a particular subcategory to which the entity belongs based on the category and the country.
Value: Enumeration; see references below for information.
References:
DIS Data Dictionary: Entity Subcategory Field
See Section 4 in EBV-DOC


specific

protected UnsignedByte specific
This field shall specify specific information about an entity based upon the subcategory field to which it belongs.
Value: Enumeration; see references below for information.
References:
DIS Data Dictionary: Entity Specific Field
See Section 4 in EBV-DOC


extra

protected UnsignedByte extra
This field shall specify extra information required to describe a particular entity. The contents of this field shall depend on the type of entity represented.
Value: Enumeration.
References:
DIS Data Dictionary: Entity Extra Field


sizeOf

public static final int sizeOf
Constant value--size of an EntityType as written out to the wire. Here: sizeOf = 8 bytes

See Also:
Constant Field Values
Constructor Detail

EntityType

public EntityType()
Default constructor--fills with zeros for all values.

Method Detail

clone

public java.lang.Object clone()
Description copied from class: PduElement
Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data. The accessor methods make copies of the objects, rather than returning the objects themselves. The runtime provides the right object type with the call to super.clone(), and we cast it to our type. Subclasses should do the same thing, and all these ivars will be taken care of automatically.

Overrides:
clone in class PduElement
Returns:
a clone of this instance
See Also:
Object

serialize

public void serialize(java.io.DataOutputStream outputStream)
Description copied from class: PduElement
Serialize our data out to the stream. Subclasses of us should call super.Serialize() to make sure the superclasse's data is serialized out. The order in which instance variables are serialized is significant. They must be serialized in the same order they appear in the DIS spec. Prints out some information during execution if debugging flag is set.

Specified by:
serialize in interface SerializationInterface
Specified by:
serialize in class PduElement
Parameters:
outputStream - the stream to which this object is serialized

deSerialize

public void deSerialize(java.io.DataInputStream inputStream)
Description copied from class: PduElement
Deserialize our data from the input stream. Subclasses of us should call super.deSerialize to make sure the superclass's data are properly affected. The order in which instance variables are serialized is significant. They must be deSerialized in the same order as they have been serialized as specified by the DIS spec.

Specified by:
deSerialize in interface SerializationInterface
Specified by:
deSerialize in class PduElement
Parameters:
inputStream - the stream from which this object is initialized

length

public int length()
Description copied from class: PduElement
Returns the length of the object when serialized in a stream.

Specified by:
length in class PduElement
Returns:
the length of the object when serialized in a stream

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
Description copied from class: PduElement
Prints the generated serialized object for debugging.

Specified by:
printValues in class PduElement
Parameters:
indentLevel - number of spaces to indent for visibility

getKind

public UnsignedByte getKind()

setKind

public void setKind(UnsignedByte pKind)

setKind

public void setKind(int pKind)

getDomain

public UnsignedByte getDomain()

setDomain

public void setDomain(UnsignedByte pDomain)

setDomain

public void setDomain(int pDomain)

getCountry

public UnsignedShort getCountry()

setCountry

public void setCountry(UnsignedShort pCountry)

setCountry

public void setCountry(int pCountry)

getCategory

public UnsignedByte getCategory()

setCategory

public void setCategory(UnsignedByte pCategory)

setCategory

public void setCategory(int pCategory)

getSubCategory

public UnsignedByte getSubCategory()

setSubCategory

public void setSubCategory(UnsignedByte pSubCategory)

setSubCategory

public void setSubCategory(int pSubCategory)

getSpecific

public UnsignedByte getSpecific()

setSpecific

public void setSpecific(UnsignedByte pSpecific)

setSpecific

public void setSpecific(int pSpecific)

getExtra

public UnsignedByte getExtra()

setExtra

public void setExtra(UnsignedByte pExtra)

setExtra

public void setExtra(int pExtra)