Class DatabaseConstantProvider

java.lang.Object
org.jlab.detector.calib.utils.DatabaseConstantProvider
All Implemented Interfaces:
ConstantProvider

public class DatabaseConstantProvider extends Object implements ConstantProvider
Author:
gavalian
  • Field Details

  • Constructor Details

    • DatabaseConstantProvider

      public DatabaseConstantProvider()
    • DatabaseConstantProvider

      public DatabaseConstantProvider(int run, String var)
    • DatabaseConstantProvider

      public DatabaseConstantProvider(int run, String var, String timestamp)
    • DatabaseConstantProvider

      public DatabaseConstantProvider(String address)
    • DatabaseConstantProvider

      public DatabaseConstantProvider(String address, String var)
  • Method Details

    • getEntrySet

      public Set<String> getEntrySet()
    • setTimeStamp

      public final void setTimeStamp(String timestamp)
    • readConstants

      public CalibrationConstants readConstants(String table_name, int nindex)
      Reads calibration constants for given table in the database.
      Parameters:
      table_name -
      nindex -
      Returns:
    • readConstants

      public CalibrationConstants readConstants(String table_name)
    • readTable

      public IndexedTable readTable(String table_name)
    • readTable

      public IndexedTable readTable(String table_name, int nindex)
    • loadTable

      public void loadTable(String table_name)
    • loadTables

      public void loadTables(String... tbl)
    • hasConstant

      public boolean hasConstant(String string)
      Description copied from interface: ConstantProvider
      Returns true if this ConstantProvider contains an entry for the given key string.
      Specified by:
      hasConstant in interface ConstantProvider
      Parameters:
      string - the key string
      Returns:
      true if the ConstnatProvider contains the given key string
    • length

      public int length(String string)
      Description copied from interface: ConstantProvider
      Returns the number of rows associated with the given key string or 0 if the ConstantProvider does not contain the key string.
      Specified by:
      length in interface ConstantProvider
      Parameters:
      string - the key string
      Returns:
      the number of rows for the key string or 0
    • getDouble

      public double getDouble(String string, int i)
      Description copied from interface: ConstantProvider
      Returns the double value for the given row associated with the given key string or 0 if the ConstnatProvider does not contain the key string, the key string does not have value at the specified row index, or the value at the specified row index is an integer.
      Specified by:
      getDouble in interface ConstantProvider
      Parameters:
      string - the key string
      i - the row index
      Returns:
      the double value for the given row associated with the given key string or 0
    • getInteger

      public int getInteger(String string, int i)
      Description copied from interface: ConstantProvider
      Returns the integer value for the given row associated with the given key string or 0 if the ConstnatProvider does not contain the key string, the key string does not have value at the specified row index, or the value at the specified row index is an double.
      Specified by:
      getInteger in interface ConstantProvider
      Parameters:
      string - the key string
      i - the row index
      Returns:
      the integer value for the given row associated with the given key string or 0
    • getString

      public String getString(String string, int i)
    • disconnect

      public void disconnect()
    • show

      public void show()
      prints out table with loaded values.
    • showString

      public String showString()
      returns a string representing a table printout of the constants
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clear

      public void clear()
    • getSize

      public int getSize()
    • getSize

      public int getSize(String name)
    • main

      public static void main(String[] args)