Class DigipeatAliasCatalog

java.lang.Object
org.ka2ddo.ax25.DigipeatAliasCatalog
All Implemented Interfaces:
Iterable<DigipeatAliasRecord>

public class DigipeatAliasCatalog extends Object implements Iterable<DigipeatAliasRecord>
This class manages the list of digipeat aliases recognized by YAAC.
Author:
Andrew Pavlin, KA2DDO
  • Method Details

    • getInstance

      public static DigipeatAliasCatalog getInstance()
      Get a reference to the singleton DigipeatAliasCatalog.
      Returns:
      the DigipeatAliasCatalog object
    • loadDefaults

      public static void loadDefaults(Preferences aliasNode)
      Load the catalog with the factory defaults.
      Parameters:
      aliasNode - Preferences node in which to store the catalog entries
    • getRowCount

      public int getRowCount()
      Get the number of defined digipeat aliases.
      Returns:
      alias count
    • addRow

      public void addRow()
      Add an empty digipeat alias definition to the catalog (used for user data entry of a new alias).
    • addRow

      public void addRow(DigipeatAliasRecord dar)
      Add a pre-filled-in digipeat alias to the catalog,
      Parameters:
      dar - DigipeatAliasRecord to add
      Throws:
      IllegalArgumentException - if alias already exists in catalog
    • deleteRow

      public void deleteRow(int rowIndex)
      Deletes the specified alias row from the catalog.
      Parameters:
      rowIndex - zero-based index of alias to delete
    • getRow

      public DigipeatAliasRecord getRow(int rowIndex)
      Get the Nth DigipeatAliasRecord in the catalog.
      Parameters:
      rowIndex - zero-based row index
      Returns:
      DigipeatAliasRecord
    • getDigipeatRecord

      public DigipeatAliasRecord getDigipeatRecord(String baseCallsign)
      Get a Digipeat alias record corresponding to the specified digipeater callsign, if such a record exists.
      Parameters:
      baseCallsign - String callsign to search for
      Returns:
      DigipeatAliasRecord describing the authorized alias, or null if no enabled match
    • getEnabledDigipeatRecord

      public DigipeatAliasRecord getEnabledDigipeatRecord(AX25Callsign callsign)
      Get a Digipeat alias record corresponding to the specified digipeater callsign, if such a record exists and is enabled.
      Parameters:
      callsign - String callsign to search for
      Returns:
      DigipeatAliasRecord describing the authorized alias, or null if no enabled match
    • isRelayAStep

      public static boolean isRelayAStep(AX25Callsign relay)
      Test if this callsign looks like a digipeat New-N alias.
      Parameters:
      relay - digipeater AX25Callsign to test
      Returns:
      boolean true if it looks like a New-N alias or other known alias
    • iterator

      public Iterator<DigipeatAliasRecord> iterator()
      Returns an iterator over the catalog of DigipeatAliasRecords.
      Specified by:
      iterator in interface Iterable<DigipeatAliasRecord>
      Returns:
      an Iterator.
    • getRegionCode

      public String getRegionCode()
      Identify what appears to be a regional alias base in the list of known aliases, if one exists.
      Returns:
      String region code name, or null if no region code defined