|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarf.Storage.SampleLoader
marf.Storage.Loaders.TextLoader
public class TextLoader
Loads text samples assuming character code to be the absolute value.
$Id: TextLoader.java,v 1.3 2008/02/16 02:07:57 mokhov Exp $
| Field Summary | |
|---|---|
protected int |
iNgramCalculationModel
Has effect with n-grams with n > 1. |
protected int |
iNgramEndiness
Indicates whether to interpret little or big endianness. |
protected int |
iNgramModel
Amount of characters per sample point. |
protected int |
iPowerBase
Amplitude numerical base interpretation. |
static int |
NGRAM_ARITHMETIC_ADD
|
static int |
NGRAM_ARITHMETIC_POWER_ADD
|
static int |
NGRAM_BIG_ENDIAN
|
static int |
NGRAM_LITTLE_ENDIAN
|
static int |
NGRAM_LOGICAL_OR
|
protected java.io.Reader |
oReader
Internal text reader object reference. |
static int |
POWER_BASE_64
|
static int |
POWER_BASE_ASCIICIMAL
|
static int |
POWER_BASE_BINARY
|
static int |
POWER_BASE_BYTECIMAL
|
static int |
POWER_BASE_DECIMAL
|
static int |
POWER_BASE_HEXADECIMAL
|
static int |
POWER_BASE_OCTAL
|
| Fields inherited from class marf.Storage.SampleLoader |
|---|
fRequiredFrequency, iRequiredBitSize, iRequiredChannels, oByteArrayOutputStream, oSample |
| Fields inherited from interface marf.Storage.ISampleLoader |
|---|
DEFAULT_CHANNELS, DEFAULT_FREQUENCY, DEFAULT_SAMPLE_BIT_SIZE, MARF_INTERFACE_CODE_REVISION |
| Constructor Summary | |
|---|---|
TextLoader()
Constructs default Text Loader. |
|
| Method Summary | |
|---|---|
static java.lang.String |
getMARFSourceCodeRevision()
Returns source code revision information. |
long |
getSampleSize()
Retrieves the length of the sample (# of data points in the stream). |
Sample |
loadSample(java.io.InputStream poDataInputStream)
Not implemented. |
int |
readSampleData(double[] padSampleData)
Reads of the next chunk of character data as amplitudes. |
int |
writeSampleData(double[] padSample,
int piLength)
TODO: Does not do any actual writing. |
| Methods inherited from class marf.Storage.SampleLoader |
|---|
getRequiredBitSize, getRequiredChannels, getRequiredFrequency, getSample, loadSample, loadSample, loadSample, reset, saveSample, saveSample, saveSample, saveSample, setRequiredBitSize, setRequiredChannels, setRequiredFrequency, setSample, updateSample |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int iNgramModel
public static final int NGRAM_LOGICAL_OR
public static final int NGRAM_ARITHMETIC_ADD
public static final int NGRAM_ARITHMETIC_POWER_ADD
protected int iNgramCalculationModel
public static final int NGRAM_LITTLE_ENDIAN
public static final int NGRAM_BIG_ENDIAN
protected int iNgramEndiness
public static final int POWER_BASE_DECIMAL
public static final int POWER_BASE_OCTAL
public static final int POWER_BASE_HEXADECIMAL
public static final int POWER_BASE_BINARY
public static final int POWER_BASE_64
public static final int POWER_BASE_ASCIICIMAL
public static final int POWER_BASE_BYTECIMAL
protected int iPowerBase
protected java.io.Reader oReader
| Constructor Detail |
|---|
public TextLoader()
throws InvalidSampleFormatException
InvalidSampleFormatException| Method Detail |
|---|
public final int readSampleData(double[] padSampleData)
throws StorageException
padSampleData - to fill in with sample data
StorageExceptionAudioSampleLoader.readAudioData(double[])
public final int writeSampleData(double[] padSample,
int piLength)
throws StorageException
padSample - used to verify the lengthpiLength - used to verify the length
StorageException - if piLength is less than zeroAudioSampleLoader.writeAudioData(double[], int)
public Sample loadSample(java.io.InputStream poDataInputStream)
throws StorageException
SampleLoader
loadSample in interface ISampleLoaderloadSample in class SampleLoaderpoDataInputStream - the stream of a sample to be read from
StorageException - if there was an error loading the sampleISampleLoader.loadSample(java.io.InputStream)
public long getSampleSize()
throws StorageException
getSampleSize in interface ISampleLoadergetSampleSize in class SampleLoaderStorageException - if there was an error getting sample sizepublic static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||