Package org.ka2ddo.ax25
Class DigipeatAliasCatalog
java.lang.Object
org.ka2ddo.ax25.DigipeatAliasCatalog
- All Implemented Interfaces:
Iterable<DigipeatAliasRecord>
This class manages the list of digipeat aliases recognized by YAAC.
- Author:
- Andrew Pavlin, KA2DDO
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRow()
Add an empty digipeat alias definition to the catalog (used for user data entry of a new alias).void
Add a pre-filled-in digipeat alias to the catalog,void
deleteRow
(int rowIndex) Deletes the specified alias row from the catalog.getDigipeatRecord
(String baseCallsign) Get a Digipeat alias record corresponding to the specified digipeater callsign, if such a record exists.getEnabledDigipeatRecord
(AX25Callsign callsign) Get a Digipeat alias record corresponding to the specified digipeater callsign, if such a record exists and is enabled.static DigipeatAliasCatalog
Get a reference to the singleton DigipeatAliasCatalog.Identify what appears to be a regional alias base in the list of known aliases, if one exists.getRow
(int rowIndex) Get the Nth DigipeatAliasRecord in the catalog.int
Get the number of defined digipeat aliases.static boolean
isRelayAStep
(AX25Callsign relay) Test if this callsign looks like a digipeat New-N alias.iterator()
Returns an iterator over the catalog of DigipeatAliasRecords.static void
loadDefaults
(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
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getInstance
Get a reference to the singleton DigipeatAliasCatalog.- Returns:
- the DigipeatAliasCatalog object
-
loadDefaults
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
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
Get the Nth DigipeatAliasRecord in the catalog.- Parameters:
rowIndex
- zero-based row index- Returns:
- DigipeatAliasRecord
-
getDigipeatRecord
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
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
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
Returns an iterator over the catalog of DigipeatAliasRecords.- Specified by:
iterator
in interfaceIterable<DigipeatAliasRecord>
- Returns:
- an Iterator.
-
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
-