Class XIDParameter

java.lang.Object
org.ka2ddo.ax25.XIDParameter

public class XIDParameter extends Object
This class encapsulates one XID parameter. The caller is responsible for putting the XIDParameter object into an appropriately typed XIDGroup object.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte[]
     
    byte
     
    byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    XIDParameter(byte paramIdentifier)
    Create an XIDParameter with an empty value (presence implies the value).
    XIDParameter(byte paramIdentifier, byte val)
    Create an XIDParameter with a 1-byte value.
    XIDParameter(byte paramIdentifier, int val, boolean is3Byte)
    Create an XIDParameter with a 3- or 4-byte value.
    XIDParameter(byte paramIdentifier, short val)
    Create an XIDParameter with a 2-byte value.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    Get the length of the parameter's value.
    Read an XIDParameter from a byte stream.
    Returns a string representation of the XIDParameter object.
    void
    Write the XIDParameter to a byte stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • EMPTY_VALUE

      public static final byte[] EMPTY_VALUE
    • paramIdentifier

      public byte paramIdentifier
    • paramValue

      public byte[] paramValue
  • Constructor Details

    • XIDParameter

      public XIDParameter(byte paramIdentifier)
      Create an XIDParameter with an empty value (presence implies the value).
      Parameters:
      paramIdentifier - identifier code
    • XIDParameter

      public XIDParameter(byte paramIdentifier, byte val)
      Create an XIDParameter with a 1-byte value.
      Parameters:
      paramIdentifier - identifier code
      val - value of parameter
    • XIDParameter

      public XIDParameter(byte paramIdentifier, short val)
      Create an XIDParameter with a 2-byte value.
      Parameters:
      paramIdentifier - identifier code
      val - value of parameter
    • XIDParameter

      public XIDParameter(byte paramIdentifier, int val, boolean is3Byte)
      Create an XIDParameter with a 3- or 4-byte value.
      Parameters:
      paramIdentifier - identifier code
      val - value of parameter
      is3Byte - boolean true if value only requires 24 bits to encode
  • Method Details

    • getParamLength

      public byte getParamLength()
      Get the length of the parameter's value.
      Returns:
      length of value in octets (bytes)
    • write

      public void write(DataOutput dos) throws IOException
      Write the XIDParameter to a byte stream.
      Parameters:
      dos - DataOutput to write the value to
      Throws:
      IOException - if write fails for any reason
    • read

      public static XIDParameter read(DataInput dis) throws IOException
      Read an XIDParameter from a byte stream.
      Parameters:
      dis - DataInput to read the parameter from
      Returns:
      decoded XIDParameter element
      Throws:
      IOException - if read fails for any reason
    • toString

      public String toString()
      Returns a string representation of the XIDParameter object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.