com.isti.quakewatch.util
Class SeismicNetworkInfo

java.lang.Object
  extended by com.isti.quakewatch.util.SeismicNetworkInfo

public class SeismicNetworkInfo
extends java.lang.Object

Class SeismicNetworkInfo holds message-building information for seismic networks.


Field Summary
static int CENTER_FIELD_LEN
          Field length for centered lines of text in headers.
 java.lang.Double[] coordinatesArray
          Coordinates array
 java.lang.String dataSourceStr
          2-letter data-source code.
 java.lang.String messageHeaderStr
          Top-of-message header string.
 java.lang.String moreInfoLinkStr
          More-information link string.
protected static FifoHashtable networkInfoTable
          Table of seismic-network-information blocks.
 java.lang.String shortMsgDescStr
          Source descriptor to be used with short-format messages.
 java.lang.String sourceOfInfoStr
          Source-of-information string shown at bottom of message.
 
Constructor Summary
SeismicNetworkInfo(java.lang.String dataSourceStr, java.lang.String messageHeaderStr, java.lang.String moreInfoLinkStr, java.lang.String sourceOfInfoStr, java.lang.String shortMsgDescStr, java.lang.Double[] coordinatesArray)
          Creates an information block of message-building data for a seismic network.
 
Method Summary
protected static void addTableEntry(java.lang.String dataSourceStr, java.lang.String messageHeaderStr, java.lang.String moreInfoLinkStr, java.lang.String sourceOfInfoStr, java.lang.String shortMsgDescStr, java.lang.Double[] coordinatesArray)
          Adds an entry to the seismic-network-information table.
static java.util.List getDataSourceNamesList()
          Returns a list of seismic-network names from the current table.
static java.lang.String getDataSourceNamesString()
          Returns a comma-separated list string of seismic-network names from the current table.
static SeismicNetworkInfo[] getNetworkInfo()
          Returns an array of the 'SeismicNetworkInfo' objects from the seismic-network-information table.
static SeismicNetworkInfo getNetworkInfo(java.lang.String dataSourceStr)
          Returns the 'SeismicNetworkInfo' object for the given data-source code from the seismic-network-information table.
static java.lang.String loadNetworkRegionsXmlFile(java.lang.String regionsXmlFName, LogFile logObj)
          Loads the seismic-network-information table from the given "regions.xml" file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CENTER_FIELD_LEN

public static final int CENTER_FIELD_LEN
Field length for centered lines of text in headers.

See Also:
Constant Field Values

dataSourceStr

public final java.lang.String dataSourceStr
2-letter data-source code.


messageHeaderStr

public final java.lang.String messageHeaderStr
Top-of-message header string.


moreInfoLinkStr

public final java.lang.String moreInfoLinkStr
More-information link string.


sourceOfInfoStr

public final java.lang.String sourceOfInfoStr
Source-of-information string shown at bottom of message.


shortMsgDescStr

public final java.lang.String shortMsgDescStr
Source descriptor to be used with short-format messages.


coordinatesArray

public final java.lang.Double[] coordinatesArray
Coordinates array


networkInfoTable

protected static final FifoHashtable networkInfoTable
Table of seismic-network-information blocks.

Constructor Detail

SeismicNetworkInfo

public SeismicNetworkInfo(java.lang.String dataSourceStr,
                          java.lang.String messageHeaderStr,
                          java.lang.String moreInfoLinkStr,
                          java.lang.String sourceOfInfoStr,
                          java.lang.String shortMsgDescStr,
                          java.lang.Double[] coordinatesArray)
Creates an information block of message-building data for a seismic network.

Parameters:
dataSourceStr - 2-letter data-source code.
messageHeaderStr - top-of-message header string.
moreInfoLinkStr - more-information link string.
sourceOfInfoStr - source-of-information string shown at bottom of message.
shortMsgDescStr - source descriptor to be used with short-format messages.
coordinatesArray - the array of coordinates.
Method Detail

loadNetworkRegionsXmlFile

public static java.lang.String loadNetworkRegionsXmlFile(java.lang.String regionsXmlFName,
                                                         LogFile logObj)
Loads the seismic-network-information table from the given "regions.xml" file.

Parameters:
regionsXmlFName - the pathname for the "regions.xml" file to use.
logObj - the LogFile object to use for outputting warning messages.
Returns:
null if successful; an error-message string if not.

getNetworkInfo

public static SeismicNetworkInfo[] getNetworkInfo()
Returns an array of the 'SeismicNetworkInfo' objects from the seismic-network-information table.

Returns:
An array of 'SeismicNetworkInfo' objects.

getNetworkInfo

public static SeismicNetworkInfo getNetworkInfo(java.lang.String dataSourceStr)
Returns the 'SeismicNetworkInfo' object for the given data-source code from the seismic-network-information table.

Parameters:
dataSourceStr - 2-letter data-source code.
Returns:
The 'SeismicNetworkInfo' object for the given data-source code, or null if no match was found.

getDataSourceNamesList

public static java.util.List getDataSourceNamesList()
Returns a list of seismic-network names from the current table.

Returns:
A list of strings, or an empty list if no names are available.

getDataSourceNamesString

public static java.lang.String getDataSourceNamesString()
Returns a comma-separated list string of seismic-network names from the current table.

Returns:
A comma-separated list string, or an empty string if no names are available.

addTableEntry

protected static void addTableEntry(java.lang.String dataSourceStr,
                                    java.lang.String messageHeaderStr,
                                    java.lang.String moreInfoLinkStr,
                                    java.lang.String sourceOfInfoStr,
                                    java.lang.String shortMsgDescStr,
                                    java.lang.Double[] coordinatesArray)
Adds an entry to the seismic-network-information table.

Parameters:
dataSourceStr - 2-letter data-source code.
messageHeaderStr - top-of-message header string.
moreInfoLinkStr - more-information link string.
sourceOfInfoStr - source-of-information string shown at bottom of message.
shortMsgDescStr - source descriptor to be used with short-format messages.
coordinatesArray - the array of coordinates or null if not available.