Class AbstractAudioDataReader<T extends AbstractAudioContainer>

  • Type Parameters:
    T - the output type
    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:
    Wave

    public abstract class AbstractAudioDataReader<T extends AbstractAudioContainer>
    extends adams.core.option.AbstractOptionHandler
    Ancestor for 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 T doRead​(Object input)
      Reads the data from the input.
      abstract Class generates()
      The output generated by the reader.
      T read​(Object input)
      Reads the data 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

      • AbstractAudioDataReader

        public AbstractAudioDataReader()
    • Method Detail

      • accepts

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

        public abstract Class generates()
        The output generated by the reader.
        Returns:
        the output type
      • 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 T doRead​(Object input)
                             throws Exception
        Reads the data from the input.
        Parameters:
        input - the input data
        Returns:
        the generated output
        Throws:
        Exception - if reading fails
      • read

        public T read​(Object input)
               throws Exception
        Reads the data from the input.
        Parameters:
        input - the input data
        Returns:
        the generated output
        Throws:
        Exception - if reading fails