public class OpenTracEntity extends OpenTracElement
id| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
getId, toStringpublic 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 encodingpublic 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 reservejava.lang.IllegalArgumentException - if id value is out of rangejava.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 IDpublic void appendElement(OpenTracElement element)
element - OpenTracElement to addpublic java.lang.String valueString()
valueString in class OpenTracElementpublic 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 OpenTracElementbuf - byte array to append the element tooffset - starting index in buf to start appending the elementpublic int length()
length in class OpenTracElementpublic AX25Message.Precedence getPrecedence()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - 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 OpenTracElementother - OpenTracElement to compare against this elementpublic int hashCode()
hashCode in class java.lang.ObjectObject.equals(Object),
System.identityHashCode(java.lang.Object)