Class AbstractCsvSampleWriter<S extends SoundSample,B extends CsvSampleWriter<S,B>>

    • Field Detail

      • _csvWriter

        protected org.refcodes.tabular.CsvStringRecordWriter _csvWriter
      • _isSamplingRateDirty

        protected boolean _isSamplingRateDirty
    • Constructor Detail

      • AbstractCsvSampleWriter

        public AbstractCsvSampleWriter​(File aFile)
                                throws FileNotFoundException
        Constructs the AbstractCsvSampleWriter for writing sound samples to a CSV file or stream.
        Parameters:
        aFile - The File where to write the CSV records to.
        Throws:
        FileNotFoundException - If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
      • AbstractCsvSampleWriter

        public AbstractCsvSampleWriter​(OutputStream aOutputStream)
        Constructs the AbstractCsvSampleWriter for writing sound samples to a CSV file or stream.
        Parameters:
        aOutputStream - The OutputStream where to write the CSV records to.
      • AbstractCsvSampleWriter

        public AbstractCsvSampleWriter​(PrintStream aPrintStream)
        Constructs the AbstractCsvSampleWriter for writing sound samples to a CSV file or stream.
        Parameters:
        aPrintStream - The PrintStream where to write the CSV records to.
      • AbstractCsvSampleWriter

        public AbstractCsvSampleWriter​(File aFile,
                                       CsvDeltaMode aDeltaMode)
                                throws FileNotFoundException
        Constructs the AbstractCsvSampleWriter for writing sound samples to a CSV file or stream.
        Parameters:
        aFile - The File where to write the CSV records to.
        aDeltaMode - The CsvDeltaMode to use when writing the CSV rows.
        Throws:
        FileNotFoundException - If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file.
      • AbstractCsvSampleWriter

        public AbstractCsvSampleWriter​(PrintStream aPrintStream,
                                       CsvDeltaMode aDeltaMode)
        Constructs the AbstractCsvSampleWriter for writing sound samples to a CSV file or stream.
        Parameters:
        aPrintStream - The PrintStream where to write the CSV records to.
        aDeltaMode - The CsvDeltaMode to use when writing the CSV rows.
      • AbstractCsvSampleWriter

        protected AbstractCsvSampleWriter​(org.refcodes.tabular.CsvStringRecordWriter aCsvFriter,
                                          CsvDeltaMode aDeltaMode)
        Constructs the AbstractCsvSampleWriter for writing sound samples to a CSV file or stream.
        Parameters:
        aCsvFriter - The CsvStringRecordWriter with which to write the CSV records with.
        aDeltaMode - The CsvDeltaMode to use when writing the CSV rows.
    • Method Detail

      • toString

        protected static String toString​(double aDouble)
        Converts a double to a string by hackishly removing trailing zeros if there is no additional value from them unifying the decimal point.
        Parameters:
        aDouble - The double to be converted to a string.
        Returns:
        The formatted double without any trailing zeros.
      • toDouble

        protected static double toDouble​(String aDouble)
        Converts a string to a double by hackishly removing trailing zeros if there is no additional value from them and unifying the decimal point.
        Parameters:
        aDouble - The double from which to remove trailing zeros.
        Returns:
        The formatted double without any trailing zeros.
      • format

        protected static String format​(String aDouble)
        Hackishly removes trailing zeros if there is no additional value from them unifying the decimal point.
        Parameters:
        aDouble - The double from which to remove trailing zeros.
        Returns:
        The formatted double without any trailing zeros.