Class AbstractAudioInfoReader

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable
    Direct Known Subclasses:
    MP3, Wave

    public abstract class AbstractAudioInfoReader
    extends adams.core.option.AbstractOptionHandler
    Ancestor for info readers for audio data.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract Class[] accepts()
      The accepted input types.
      protected String check​(Object input)
      Performs checks before reading from the input.
      protected abstract Map<String,​Object> doRead​(Object input)
      Reads the info from the input.
      Map<String,​Object> read​(Object input)
      Reads the info from the input.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Constructor Detail

      • AbstractAudioInfoReader

        public AbstractAudioInfoReader()
    • Method Detail

      • accepts

        public abstract Class[] accepts()
        The accepted input types.
        Returns:
        the input types
      • check

        protected String check​(Object input)
        Performs checks before reading from the input.
        Parameters:
        input - the input to read
        Returns:
        null if successful, otherwise error message
      • doRead

        protected abstract Map<String,​Object> doRead​(Object input)
                                                    throws Exception
        Reads the info from the input.
        Parameters:
        input - the input data
        Returns:
        the generated info
        Throws:
        Exception - if reading fails
      • read

        public Map<String,​Object> read​(Object input)
                                      throws Exception
        Reads the info from the input.
        Parameters:
        input - the input data
        Returns:
        the generated info
        Throws:
        Exception - if reading fails