org.opensha.nshmp.sha.calc
Class TsubL

java.lang.Object
  extended by org.opensha.nshmp.sha.calc.TsubL

public class TsubL
extends java.lang.Object

This class is meant to be a lightweight data miner class for fetching T sub L values from the database. This can be run stand-alone on the command line or programatically with a latitude and longitude.

Author:
emartinez

Constructor Summary
TsubL(java.sql.Connection conn)
          Constructor for the TsubL data miner class.
 
Method Summary
 double get(double latitude, double longitude)
          Queries the database using the prepared statement based on the STUB.
static void main(java.lang.String[] args)
          Simple test method wrapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TsubL

public TsubL(java.sql.Connection conn)
      throws java.lang.Exception
Constructor for the TsubL data miner class. This constructor requires an active database connection.

Parameters:
conn - An active database connection
Throws:
java.lang.Exception - If an exception occurs
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Simple test method wrapper. Provides command line access to T sub L data mining functionality.

Parameters:
args - Command line arguments. Should be two arguments, first is latitude (decimal degrees) second is longitude (decimal degrees).
Throws:
java.lang.Exception - If an exception occurs. Generally a number format exception (from poorly formatted input), or an SQL exception from the database.

get

public double get(double latitude,
                  double longitude)
           throws java.lang.Exception
Queries the database using the prepared statement based on the STUB. The latitude value is inserted into the first STUB placeholder and the longitude value is inserted into the second STUB placeholder.

Parameters:
latitude - Latitude (decimal degrees) for the target location
longitude - Longitude (decimal degrees) for the target location
Returns:
The T sub L value for the target location
Throws:
java.lang.Exception - If an SQLException occurs or if the query fails to return data.