org.ka2ddo.yaac.gui
Class SelectableSymbol

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

public class SelectableSymbol
extends java.lang.Object
implements java.lang.Comparable<SelectableSymbol>, java.io.Serializable

This class is a wrapper around a pair of characters representing an APRS symbol.

See Also:
Serialized Form

Field Summary
 char symbolCode
          The APRS symbol code for this symbol.
 char symTableId
          The APRS symbol table ID ('/' or '\') or overlay character (0-9 or A-Z) for this symbol.
 
Constructor Summary
SelectableSymbol(char symTableId, char symbolCode)
          Construct a SelectableSymbol for the specified APRS symTableId and symbolCode characters.
 
Method Summary
 int compareTo(SelectableSymbol o)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
static SelectableSymbol[] getTypeCodes(boolean withLeadingNull)
          Provide a list of all standard symbol combinations, with a null default.
 int hashCode()
          Returns a hash code value for the object.
 java.lang.String toString()
          Returns a string representation of the object.
static SelectableSymbol 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 Detail

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 Detail

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 Detail

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.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(), Hashtable

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 java.lang.Object
Returns:
a hash code value for this object.
See Also:
equals(java.lang.Object)

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.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 java.lang.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:
java.lang.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