Class LocalDestinationRecord

java.lang.Object
org.ka2ddo.yaac.aprs.LocalDestinationRecord
All Implemented Interfaces:
Comparable<LocalDestinationRecord>

public class LocalDestinationRecord extends Object implements Comparable<LocalDestinationRecord>
This class defines one local destination callsign record. This record type may also be used for group multicasts for groups this station is a member of.
Author:
Andrew Pavlin, KA2DDO
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The callsign or group label for messages that should be considered as addressed to the local station.
    boolean
    Flag indicating whether this LocalDestinationRecord should be used.
    The event type (if any) that should be reported for messages received for this callsign.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an empty LocalDestinationRecord suitable for editing through a GUI interface.
    Create a LocalDestinationRecord for a specific callsign or group label.
    LocalDestinationRecord(String callsign, boolean enabled)
    Create a LocalDestinationRecord for a specific callsign or group label with no associated event type.
  • 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.
    int
    Returns a hash code value for the object.
    void
    Load this callsign-named record from the specified Preferences node.
    Returns a string representation of the object.
    void
    Store the contents of this record in a Java Preferences node.

    Methods inherited from class java.lang.Object

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

    • callsign

      public String callsign
      The callsign or group label for messages that should be considered as addressed to the local station.
    • enabled

      public boolean enabled
      Flag indicating whether this LocalDestinationRecord should be used.
    • eventType

      public MsgEventType eventType
      The event type (if any) that should be reported for messages received for this callsign.
  • Constructor Details

    • LocalDestinationRecord

      public LocalDestinationRecord()
      Create an empty LocalDestinationRecord suitable for editing through a GUI interface. Initially disabled until something later fills it in.
    • LocalDestinationRecord

      public LocalDestinationRecord(String callsign)
      Create a LocalDestinationRecord for a specific callsign or group label. Initially disabled and with no event type.
      Parameters:
      callsign - String of callsign or group label
    • LocalDestinationRecord

      public LocalDestinationRecord(String callsign, boolean enabled)
      Create a LocalDestinationRecord for a specific callsign or group label with no associated event type.
      Parameters:
      callsign - String of callsign or group label
      enabled - boolean true if this record should be enabled
  • 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(LocalDestinationRecord 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<LocalDestinationRecord>
      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.
    • writeToPreferences

      public void writeToPreferences(Preferences prefs)
      Store the contents of this record in a Java Preferences node.
      Parameters:
      prefs - Preferences node to hold the saved value
    • readFromPreferences

      public void readFromPreferences(Preferences prefs)
      Load this callsign-named record from the specified Preferences node.
      Parameters:
      prefs - Preferences node with a key-value pair matching the callsign of this record