Class SpectrumT

  • All Implemented Interfaces:
    adams.core.logging.LoggingSupporter, adams.core.SizeOfHandler, adams.db.DatabaseConnectionProvider, adams.db.DatabaseConnectionUser, adams.db.DataProvider<Spectrum>, SpectrumIntf, adams.db.SQLIntf, adams.db.TableInterface, adams.event.DatabaseConnectionChangeListener, Serializable

    public class SpectrumT
    extends SpectrumT
    SQLite implementation.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static adams.db.TableManager<SpectrumT> m_TableManager
      the table manager.
      • Fields inherited from class adams.db.AbstractIndexedTable

        m_init
      • Fields inherited from class adams.db.AbstractTable

        FILENAME, m_AnsiQuotes, m_Properties, m_TableName
      • Fields inherited from class adams.db.generic.SQL

        m_DatabaseConnection, m_Debug, m_Queries, m_Quirks
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
      • Fields inherited from interface adams.db.SQLIntf

        FAKE_TABLE_NAME
    • Constructor Summary

      Constructors 
      Constructor Description
      SpectrumT​(adams.db.AbstractDatabaseConnection dbcon)
      Constructor - initalise with database connection.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Integer add​(Spectrum sp, boolean storeWaveNo)
      Adds a spectrum to the database.
      SampleDataIntf getSampleDataHandler()
      Returns the corresponding SampleData handler.
      static SpectrumIntf getSingleton​(adams.db.AbstractDatabaseConnection dbcon)
      Returns the singleton of the table (active).
      static void initTable​(adams.db.AbstractDatabaseConnection dbcon)
      Initializes the table.
      • Methods inherited from class adams.db.AbstractIndexedTable

        columnsMatch, columnsMatchTest, create, getAllColumns, getTables, initTables, isThere, postCreate, select, select, selectDistinct, selectDistinct, truncate, update
      • Methods inherited from class adams.db.AbstractTable

        columnExists, databaseConnectionStateChanged, getProperties, getQueries, getTableName, isEnabled, quoteName, tableExists, toString, useAnsiQuotes
      • Methods inherited from class adams.db.generic.SQL

        columnExists, doSelect, drop, execute, executeGeneratedKeys, getDatabaseConnection, getDebug, getMaxColumnNameLength, getResultSet, getSimpleResultSet, prepareStatement, prepareStatement, prepareStatement, select, selectDistinct, selectDouble, selectInt, selectLong, selectString, selectStrings, setDebug, singleton, tableExists, truncate, update, updatePrefix, updateTableName
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.db.DatabaseConnectionProvider

        getDatabaseConnection
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
      • Methods inherited from interface adams.db.TableInterface

        getTableName
    • Field Detail

      • m_TableManager

        protected static adams.db.TableManager<SpectrumT> m_TableManager
        the table manager.
    • Constructor Detail

      • SpectrumT

        public SpectrumT​(adams.db.AbstractDatabaseConnection dbcon)
        Constructor - initalise with database connection.
        Parameters:
        dbcon - the database context this table is used in
    • Method Detail

      • getSampleDataHandler

        public SampleDataIntf getSampleDataHandler()
        Returns the corresponding SampleData handler.
        Returns:
        the corresponding handler
      • add

        public Integer add​(Spectrum sp,
                           boolean storeWaveNo)
        Adds a spectrum to the database. Returns the created auto-id, and sets in Spectrum.
        Specified by:
        add in interface SpectrumIntf
        Overrides:
        add in class SpectrumT
        Parameters:
        sp - spectrum Header
        storeWaveNo - whether to store the wave numbers as well
        Returns:
        new ID, or null if fail
      • initTable

        public static void initTable​(adams.db.AbstractDatabaseConnection dbcon)
        Initializes the table. Used by the "InitializeTables" tool.
        Parameters:
        dbcon - the database context
      • getSingleton

        public static SpectrumIntf getSingleton​(adams.db.AbstractDatabaseConnection dbcon)
        Returns the singleton of the table (active).
        Parameters:
        dbcon - the database connection to get the singleton for
        Returns:
        the singleton