Class SelectableSymbol

java.lang.Object
org.ka2ddo.yaac.gui.SelectableSymbol
All Implemented Interfaces:
Serializable, Comparable<SelectableSymbol>

public class SelectableSymbol extends Object implements Comparable<SelectableSymbol>, Serializable
This class is a wrapper around a pair of characters representing an APRS symbol.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final char
    The APRS symbol code for this symbol.
    final char
    The APRS symbol table ID ('/' or '\') or overlay character (0-9 or A-Z) for this symbol.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SelectableSymbol(char symTableId, char symbolCode)
    Construct a SelectableSymbol for the specified APRS symTableId and symbolCode characters.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares this object with the specified object for order.
    boolean
    Indicates whether some other object is "equal to" this one.
    getTypeCodes(boolean withLeadingNull)
    Provide a list of all standard symbol combinations, with a null default.
    int
    Returns a hash code value for the object.
    Returns a string representation of the object.
    valueOf(char symTableId, char symbolCode)
    Return a SelectableSymbol object corresponding to the specified pair of characters.

    Methods inherited from class java.lang.Object

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

    • symTableId

      public final char symTableId
      The APRS symbol table ID ('/' or '\') or overlay character (0-9 or A-Z) for this symbol.
    • symbolCode

      public final char symbolCode
      The APRS symbol code for this symbol.
  • Constructor Details

    • SelectableSymbol

      public SelectableSymbol(char symTableId, char symbolCode)
      Construct a SelectableSymbol for the specified APRS symTableId and symbolCode characters.
      Parameters:
      symTableId - printable ASCII character for the symbol table ID or overlay
      symbolCode - printable ASCII character for the symbol code
  • Method Details

    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
      See Also:
    • hashCode

      public int hashCode()
      Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.
      See Also:
    • toString

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

      public int compareTo(SelectableSymbol o)
      Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Specified by:
      compareTo in interface Comparable<SelectableSymbol>
      Parameters:
      o - the object to be compared.
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Throws:
      ClassCastException - if the specified object's type prevents it from being compared to this object.
    • valueOf

      public static SelectableSymbol valueOf(char symTableId, char symbolCode)
      Return a SelectableSymbol object corresponding to the specified pair of characters. Cache objects to reduce the amount of wasted memory for common symbol combinations.
      Parameters:
      symTableId - char symbol table identifier
      symbolCode - char code for the specific symbol within the specified table
      Returns:
      SelectableSymbol object representing the pair of characters
    • getTypeCodes

      public static SelectableSymbol[] getTypeCodes(boolean withLeadingNull)
      Provide a list of all standard symbol combinations, with a null default.
      Parameters:
      withLeadingNull - boolean true if a null leading entry should be in the returned array for "no symbol specified yet"
      Returns:
      array of SelectableSymbol records