|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.opentrac.OpenTracElement
org.ka2ddo.opentrac.OpenTracEntity
public class OpenTracEntity
This class defines a sub-component of an OpenTracMessage, for the information elements about one entity managed by a station, where entity extension ID #0 is the station itself. Note that the station callsign-SSID does not have to be for the transmitting station (i.e., this can be a digipeated or I-gated message whose Level 2 wrapper is using the callsign-SSID of the repeating station, not the originating station).
Field Summary |
---|
Fields inherited from class org.ka2ddo.opentrac.OpenTracElement |
---|
id |
Constructor Summary | |
---|---|
OpenTracEntity()
Create an empty uninitialized OpenTracEntity. |
|
OpenTracEntity(AX25Callsign station,
short extensionId)
Create an empty uninitialized OpenTracEntity for the specified callsign/SSID and extension ID. |
|
OpenTracEntity(byte[] body,
int offset,
int length,
boolean includesExtension)
Read an OpenTracEntity from a byte array. |
|
OpenTracEntity(OpenTracEntity oldEntity,
int sequenceNumber)
Create an uninitialized clone of another OpenTracEntity with the changed sequence number. |
|
OpenTracEntity(java.lang.String station,
short extensionId)
Create an empty uninitialized OpenTracEntity for the specified callsign/SSID and extension ID. |
Method Summary | |
---|---|
void |
appendElement(OpenTracElement element)
Add another element to this entity. |
int |
computeBody(byte[] buf,
int offset)
Generate an OpenTrac entity ID element for this entity. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
boolean |
equals(OpenTracElement other)
Test if this OpenTracElement has the same type and value as another OpenTracElement. |
java.lang.String |
getCallsign()
Get the callsign of this entity with any appended SSID. |
java.lang.String |
getEntityName()
Get the full name of this entity with any appended SSID and entity ID |
short |
getExtensionId()
Get the ID number of the extension being reported by this entity. |
OpenTracElement |
getMatchingElement(int type)
Get the first element of this entity of the specified OpenTrac element ID. |
static short |
getNextAvailableEntityId()
Get an unused entity ID number for an OpenTracEntity record. |
AX25Message.Precedence |
getPrecedence()
Report the traffic-handling precedence for this entity's elements. |
int |
getSequenceNumber()
Get the sequence number for the data in this entity. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isEntityAddressed()
Test if this entity has been properly addressed. |
boolean |
isEntityEmpty()
Test if this entity has any elements. |
int |
length()
Return the number of bytes needed to encode this entity, including all its child elements. |
static void |
reserveEntityId(short id)
Reserve an entity ID value as already in use. |
void |
setCallsign(java.lang.String callsign)
Set the callsign-SSID of this entity. |
java.lang.String |
valueString()
Returns a string representation of the value of this entity. |
Methods inherited from class org.ka2ddo.opentrac.OpenTracElement |
---|
getId, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OpenTracEntity()
public OpenTracEntity(AX25Callsign station, short extensionId)
station
- AX25Callsign of station containing the entityextensionId
- extension ID for sub-element within the stationpublic OpenTracEntity(java.lang.String station, short extensionId)
station
- String of station containing the entityextensionId
- extension ID for sub-element within the stationpublic OpenTracEntity(OpenTracEntity oldEntity, int sequenceNumber)
oldEntity
- OpenTracEntity whose identifiers should be copiedsequenceNumber
- the sequence number to use for this copypublic OpenTracEntity(byte[] body, int offset, int length, boolean includesExtension)
body
- byte array to read the entity fromoffset
- zero-based starting position in the array to read the entity fromlength
- number of bytes to read from the arrayincludesExtension
- boolean true if entity includes the extension ID in its encodingMethod Detail |
---|
public static short getNextAvailableEntityId() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if no entity ID values are left unusedpublic static void reserveEntityId(short id) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
id
- entity ID value to reserve
java.lang.IllegalArgumentException
- if id value is out of range
java.lang.IllegalStateException
- if specified entity ID value is already in usepublic short getExtensionId()
public int getSequenceNumber()
public boolean isEntityEmpty()
public OpenTracElement getMatchingElement(int type)
type
- OpenTrac element ID
public void appendElement(OpenTracElement element)
element
- OpenTracElement to addpublic java.lang.String valueString()
valueString
in class OpenTracElement
public boolean isEntityAddressed()
public java.lang.String getCallsign()
public void setCallsign(java.lang.String callsign)
callsign
- String form of the SSID-qualified callsignpublic java.lang.String getEntityName()
public int computeBody(byte[] buf, int offset)
computeBody
in class OpenTracElement
buf
- byte array to append the element tooffset
- starting index in buf to start appending the element
public int length()
length
in class OpenTracElement
public AX25Message.Precedence getPrecedence()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.public boolean equals(OpenTracElement other)
equals
in class OpenTracElement
other
- OpenTracElement to compare against this element
public int hashCode()
hashCode
in class java.lang.Object
Object.equals(Object)
,
System.identityHashCode(java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |