Package org.jlab.detector.calib.utils
Class DatabaseConstantProvider
java.lang.Object
org.jlab.detector.calib.utils.DatabaseConstantProvider
- All Implemented Interfaces:
ConstantProvider
- Author:
- gavalian
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseConstantProvider
(int run, String var) DatabaseConstantProvider
(int run, String var, String timestamp) DatabaseConstantProvider
(String address) DatabaseConstantProvider
(String address, String var) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
double
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.int
getInteger
(String string, int i) 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.int
getSize()
int
boolean
hasConstant
(String string) Returns true if this ConstantProvider contains an entry for the given key string.int
Returns the number of rows associated with the given key string or 0 if the ConstantProvider does not contain the key string.void
void
loadTables
(String... tbl) static void
readConstants
(String table_name) readConstants
(String table_name, int nindex) Reads calibration constants for given table in the database.final void
setTimeStamp
(String timestamp) void
show()
prints out table with loaded values.returns a string representing a table printout of the constantstoString()
-
Field Details
-
DEFAULT_INDICES
public static final int DEFAULT_INDICES- See Also:
-
DEFAULT_ADDRESS
- See Also:
-
-
Constructor Details
-
DatabaseConstantProvider
public DatabaseConstantProvider() -
DatabaseConstantProvider
-
DatabaseConstantProvider
-
DatabaseConstantProvider
-
DatabaseConstantProvider
-
-
Method Details
-
getEntrySet
-
setTimeStamp
-
readConstants
Reads calibration constants for given table in the database.- Parameters:
table_name
-nindex
-- Returns:
-
readConstants
-
readTable
-
readTable
-
loadTable
-
loadTables
-
hasConstant
Description copied from interface:ConstantProvider
Returns true if this ConstantProvider contains an entry for the given key string.- Specified by:
hasConstant
in interfaceConstantProvider
- Parameters:
string
- the key string- Returns:
- true if the ConstnatProvider contains the given key string
-
length
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 interfaceConstantProvider
- Parameters:
string
- the key string- Returns:
- the number of rows for the key string or 0
-
getDouble
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 interfaceConstantProvider
- Parameters:
string
- the key stringi
- the row index- Returns:
- the double value for the given row associated with the given key string or 0
-
getInteger
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 interfaceConstantProvider
- Parameters:
string
- the key stringi
- the row index- Returns:
- the integer value for the given row associated with the given key string or 0
-
getString
-
disconnect
public void disconnect() -
show
public void show()prints out table with loaded values. -
showString
returns a string representing a table printout of the constants- Returns:
-
toString
-
clear
public void clear() -
getSize
public int getSize() -
getSize
-
main
-