org.ka2ddo.ax25
Class DigipeatAliasCatalog

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

public class DigipeatAliasCatalog
extends java.lang.Object
implements java.lang.Iterable<DigipeatAliasRecord>

This class manages the list of digipeat aliases recognized by YAAC.


Method Summary
 void addRow()
          Add an empty digipeat alias definition to the catalog (used for user data entry of a new alias).
 void addRow(DigipeatAliasRecord dar)
          Add a pre-filled-in digipeat alias to the catalog,
 void deleteRow(int rowIndex)
          Deletes the specified alias row from the catalog.
 DigipeatAliasRecord getDigipeatRecord(java.lang.String baseCallsign)
          Get a Digipeat alias record corresponding to the specified digipeater callsign, if such a record exists.
 DigipeatAliasRecord getEnabledDigipeatRecord(AX25Callsign callsign)
          Get a Digipeat alias record corresponding to the specified digipeater callsign, if such a record exists and is enabled.
static DigipeatAliasCatalog getInstance()
          Get a reference to the singleton DigipeatAliasCatalog.
 java.lang.String getRegionCode()
          Identify what appears to be a regional alias base in the list of known aliases, if one exists.
 DigipeatAliasRecord getRow(int rowIndex)
          Get the Nth DigipeatAliasRecord in the catalog.
 int getRowCount()
          Get the number of defined digipeat aliases.
static boolean isRelayAStep(AX25Callsign relay)
           
 java.util.Iterator<DigipeatAliasRecord> iterator()
          Returns an iterator over the catalog of DigipeatAliasRecords.
 void loadDefaults(java.util.prefs.Preferences aliasNode)
          Load the catalog with the factory defaults.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DigipeatAliasCatalog getInstance()
Get a reference to the singleton DigipeatAliasCatalog.

Returns:
the DigipeatAliasCatalog object

loadDefaults

public void loadDefaults(java.util.prefs.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:
java.lang.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(java.lang.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)

iterator

public java.util.Iterator<DigipeatAliasRecord> iterator()
Returns an iterator over the catalog of DigipeatAliasRecords.

Specified by:
iterator in interface java.lang.Iterable<DigipeatAliasRecord>
Returns:
an Iterator.

getRegionCode

public java.lang.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