Package org.ka2ddo.yaac.aprs
Class MessageGroupCatalog
java.lang.Object
org.ka2ddo.yaac.aprs.MessageGroupCatalog
This class manages the list of callsigns (station and tactical) that are considered
for local delivery here.
- Author:
- Andrew Pavlin, KA2DDO
-
Method Summary
Modifier and TypeMethodDescriptionaddRow()
Create a new initially-disabled LocalDestinationRecord to the catalog.void
deleteRow
(int rowIndex) Delete the specified record from the catalog, including from the Preferences backing store.void
Persist the specified LocalDestinationRecord to Preferences.Get a list of all locally-defined destinations.static MessageGroupCatalog
Get the singleton MessageGroupCatalog object.getLocalDestination
(String callsign) Test if the specified addressee is recognized as an alias for the local station.int
Get the number of message groups registered in the catalog.getRow
(int rowIndex) Get the Nth record in the MessageGroupCatalog.void
init
(Preferences prefs) Load the MessageGroupCatalog with persisted values from the Java Preferences store.insertDefaultRow
(int row, String callsign) Create a new initially-enabled LocalDestinationRecord at the specified index within the catalog.
-
Method Details
-
getInstance
Get the singleton MessageGroupCatalog object.- Returns:
- singleton MessageGroupCatalog
-
init
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
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
Create a new initially-disabled LocalDestinationRecord to the catalog.- Returns:
- an empty LocalDestinationRecord (not yet written to Preferences)
-
insertDefaultRow
Create a new initially-enabled LocalDestinationRecord at the specified index within the catalog.- Parameters:
row
- zero-based index where new record should be insertedcallsign
- String alias to be assigned to the new record- Returns:
- created LocalDestinationRecord
-
flushToPreferences
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
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
Get a list of all locally-defined destinations.- Returns:
- array of LocalDestinationRecords for only records not pre-defined by YAAC distribution
-