S
- The SoundSample
(sub-)type on which the
SampleWriter
implementation is to operate on.B
- The CsvSampleWriter
implementing this
AbstractCsvSampleWriter
.AutoCloseable
, CsvSampleWriter<S,B>
, SampleWriter<S,B>
, SamplingRateAccessor
, SamplingRateAccessor.SamplingRateBuilder<S>
, SamplingRateAccessor.SamplingRateMutator
, SamplingRateAccessor.SamplingRateProperty
, org.refcodes.io.RowWriter<S>
CsvMonoSampleWriter
, CsvSoundSampleWriter
public abstract class AbstractCsvSampleWriter<S extends SoundSample,B extends CsvSampleWriter<S,B>> extends Object implements CsvSampleWriter<S,B>
AbstractCsvSampleWriter
provides a foundation to write sound
samples to a CSV file.SamplingRateAccessor.SamplingRateBuilder<B extends SamplingRateAccessor.SamplingRateBuilder<B>>, SamplingRateAccessor.SamplingRateMutator, SamplingRateAccessor.SamplingRateProperty
Modifier and Type | Field | Description |
---|---|---|
protected org.refcodes.tabular.CsvStringRecordWriter |
_csvWriter |
|
protected CsvDeltaMode |
_deltaMode |
|
protected boolean |
_isSamplingRateDirty |
Modifier | Constructor | Description |
---|---|---|
|
AbstractCsvSampleWriter(File aFile) |
Constructs the
AbstractCsvSampleWriter for writing sound samples
to a CSV file or stream. |
|
AbstractCsvSampleWriter(File aFile,
CsvDeltaMode aDeltaMode) |
Constructs the
AbstractCsvSampleWriter for writing sound samples
to a CSV file or stream. |
|
AbstractCsvSampleWriter(OutputStream aOutputStream) |
Constructs the
AbstractCsvSampleWriter for writing sound samples
to a CSV file or stream. |
|
AbstractCsvSampleWriter(OutputStream aOutputStream,
CsvDeltaMode aDeltaMode) |
Constructs the
AbstractCsvSampleWriter for writing sound samples
to a CSV file or stream. |
|
AbstractCsvSampleWriter(PrintStream aPrintStream) |
Constructs the
AbstractCsvSampleWriter for writing sound samples
to a CSV file or stream. |
|
AbstractCsvSampleWriter(PrintStream aPrintStream,
CsvDeltaMode aDeltaMode) |
Constructs the
AbstractCsvSampleWriter for writing sound samples
to a CSV file or stream. |
protected |
AbstractCsvSampleWriter(org.refcodes.tabular.CsvStringRecordWriter aCsvFriter,
CsvDeltaMode aDeltaMode) |
Constructs the
AbstractCsvSampleWriter for writing sound samples
to a CSV file or stream. |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
protected static String |
format(String aDouble) |
Hackishly removes trailing zeros if there is no additional value from
them unifying the decimal point.
|
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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeNext
getSamplingRate
withSamplingRate
setSamplingRate
letSamplingRate
protected org.refcodes.tabular.CsvStringRecordWriter _csvWriter
protected CsvDeltaMode _deltaMode
protected boolean _isSamplingRateDirty
public AbstractCsvSampleWriter(File aFile) throws FileNotFoundException
AbstractCsvSampleWriter
for writing sound samples
to a CSV file or stream.aFile
- The File
where to write the CSV records to.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.public AbstractCsvSampleWriter(OutputStream aOutputStream)
AbstractCsvSampleWriter
for writing sound samples
to a CSV file or stream.aOutputStream
- The OutputStream
where to write the CSV
records to.public AbstractCsvSampleWriter(PrintStream aPrintStream)
AbstractCsvSampleWriter
for writing sound samples
to a CSV file or stream.aPrintStream
- The PrintStream
where to write the CSV
records to.public AbstractCsvSampleWriter(File aFile, CsvDeltaMode aDeltaMode) throws FileNotFoundException
AbstractCsvSampleWriter
for writing sound samples
to a CSV file or stream.aFile
- The File
where to write the CSV records to.aDeltaMode
- The CsvDeltaMode
to use when writing the CSV
rows.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.public AbstractCsvSampleWriter(OutputStream aOutputStream, CsvDeltaMode aDeltaMode)
AbstractCsvSampleWriter
for writing sound samples
to a CSV file or stream.aOutputStream
- The OutputStream
where to write the CSV
records to.aDeltaMode
- The CsvDeltaMode
to use when writing the CSV
rows.public AbstractCsvSampleWriter(PrintStream aPrintStream, CsvDeltaMode aDeltaMode)
AbstractCsvSampleWriter
for writing sound samples
to a CSV file or stream.aPrintStream
- The PrintStream
where to write the CSV
records to.aDeltaMode
- The CsvDeltaMode
to use when writing the CSV
rows.protected AbstractCsvSampleWriter(org.refcodes.tabular.CsvStringRecordWriter aCsvFriter, CsvDeltaMode aDeltaMode)
AbstractCsvSampleWriter
for writing sound samples
to a CSV file or stream.aCsvFriter
- The CsvStringRecordWriter
with which to write
the CSV records with.aDeltaMode
- The CsvDeltaMode
to use when writing the CSV
rows.public void close() throws IOException
close
in interface AutoCloseable
close
in interface SampleWriter<S extends SoundSample,B extends CsvSampleWriter<S,B>>
IOException
protected static String toString(double aDouble)
aDouble
- The double to be converted to a string.protected static double toDouble(String aDouble)
aDouble
- The double from which to remove trailing zeros.Copyright © 2021. All rights reserved.