Class MessageGroupCatalog

java.lang.Object
org.ka2ddo.yaac.aprs.MessageGroupCatalog

public class MessageGroupCatalog extends Object
This class manages the list of callsigns (station and tactical) that are considered for local delivery here.
Author:
Andrew Pavlin, KA2DDO
  • Method Details

    • getInstance

      public static MessageGroupCatalog getInstance()
      Get the singleton MessageGroupCatalog object.
      Returns:
      singleton MessageGroupCatalog
    • init

      public void init(Preferences prefs) throws BackingStoreException
      Load the MessageGroupCatalog with persisted values from the Java Preferences store.
      Parameters:
      prefs - root Preferences node of YAAC configuration
      Throws:
      BackingStoreException - if preferences could not be read for any reason
    • getMessageGroupCount

      public int getMessageGroupCount()
      Get the number of message groups registered in the catalog.
      Returns:
      message group count
    • getRow

      public LocalDestinationRecord getRow(int rowIndex)
      Get the Nth record in the MessageGroupCatalog. Intended for use by GUI table models,
      Parameters:
      rowIndex - zero-based index of record to fetch
      Returns:
      LocalDestinationRecord from the catalog
    • addRow

      public LocalDestinationRecord addRow()
      Create a new initially-disabled LocalDestinationRecord to the catalog.
      Returns:
      an empty LocalDestinationRecord (not yet written to Preferences)
    • insertDefaultRow

      public LocalDestinationRecord insertDefaultRow(int row, String callsign)
      Create a new initially-enabled LocalDestinationRecord at the specified index within the catalog.
      Parameters:
      row - zero-based index where new record should be inserted
      callsign - String alias to be assigned to the new record
      Returns:
      created LocalDestinationRecord
    • flushToPreferences

      public void flushToPreferences(LocalDestinationRecord ldr)
      Persist the specified LocalDestinationRecord to Preferences.
      Parameters:
      ldr - LocalDestinationRecord to save
    • deleteRow

      public void deleteRow(int rowIndex)
      Delete the specified record from the catalog, including from the Preferences backing store.
      Parameters:
      rowIndex - zero-based index of record to delete
    • getLocalDestination

      public LocalDestinationRecord getLocalDestination(String callsign)
      Test if the specified addressee is recognized as an alias for the local station.
      Parameters:
      callsign - String to test against known local aliases
      Returns:
      LocalDestinationRecord if the callsign matches an entry, else null
    • getCustomDestinations

      public LocalDestinationRecord[] getCustomDestinations()
      Get a list of all locally-defined destinations.
      Returns:
      array of LocalDestinationRecords for only records not pre-defined by YAAC distribution