|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.tools.AbstractObservable<Operator>
com.rapidminer.operator.Operator
com.rapidminer.operator.io.AbstractReader<ExampleSet>
com.rapidminer.operator.io.AbstractExampleSource
com.rapidminer.operator.io.BytewiseExampleSource
public abstract class BytewiseExampleSource
Superclass for file data source operators which read the file byte per byte into a byte array and extract the actual data from that array. This class provides some methods to extract integer and floating point values from such an array.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.rapidminer.operator.io.AbstractReader |
|---|
AbstractReader.ReaderDescription |
| Field Summary | |
|---|---|
protected static java.lang.String |
GENERIC_ERROR_MESSAGE
A generic wrong file format error message. |
protected static int |
LENGTH_BYTE
The length of a byte measured in bytes. |
protected static int |
LENGTH_DOUBLE
The length of a double measured in bytes. |
protected static int |
LENGTH_INT_32
The length of an int measured in bytes. |
static java.lang.String |
PARAMETER_DATAMANAGEMENT
The parameter name for "Determines, how the data is represented internally. |
static java.lang.String |
PARAMETER_FILENAME
The parameter name for "Name of the file to read the data from. |
protected static java.lang.String |
UNSPECIFIED_ERROR_MESSAGE
A even more generic error message. |
| Constructor Summary | |
|---|---|
BytewiseExampleSource(OperatorDescription description)
|
|
| Method Summary | |
|---|---|
ExampleSet |
createExampleSet()
Creates (or reads) the ExampleSet that will be returned by Operator.apply(). |
protected int |
extract2ByteInt(byte[] buffer,
int offset,
boolean reverseEndian)
Extracts a 2-byte (short) int from a byte array. |
protected double |
extractDouble(byte[] value,
int offset,
boolean reverseEndian)
Extracts a double from a byte array. |
protected float |
extractFloat(byte[] value,
int offset,
boolean reverseEndian)
Extracts a float from a byte array. |
protected int |
extractInt(byte[] buffer,
int offset,
boolean reverseEndian)
Extracts an int from a byte array. |
protected java.lang.String |
extractString(byte[] value,
int offset,
int length)
Extracts string from byte array. |
protected abstract java.lang.String |
getFileSuffix()
Returns the suffix of the files which should be read by the input operator. |
java.util.List<ParameterType> |
getParameterTypes()
Returns a list of ParameterTypes describing the parameters of this operator. |
protected int |
read(java.io.InputStream inputStream,
byte[] buffer,
char divider)
Reads bytes from a given file reader until either a certain character is read, the buffer is completely filled or the end of file is reached. |
protected int |
read(java.io.InputStream inputStream,
byte[] buffer,
char[] divider)
Reads bytes from a given file reader until either a specified character sequence is read, the buffer is completely filled or the end of file is reached. |
protected int |
read(java.io.InputStream inputStream,
byte[] buffer,
int length)
Reads a number (specified by length) of bytes from a given file reader into a byte array beginning at index 0. |
protected int |
read(java.io.InputStream inputStream,
byte[] buffer,
int offset,
int length)
Reads a number (specified by length) of bytes from a given file reader into a byte array beginning at the given offset. |
protected abstract ExampleSet |
readStream(java.io.InputStream inputStream,
DataRowFactory dataRowFactory)
Reads the given file and constructs an example set from the read data. |
protected int |
readWithoutLengthCheck(java.io.InputStream inputStream,
byte[] buffer,
int length)
Reads a number (specified by length) of bytes from a given file reader into a byte array beginning at index 0. |
| Methods inherited from class com.rapidminer.operator.io.AbstractExampleSource |
|---|
getGeneratedMetaData, read |
| Methods inherited from class com.rapidminer.operator.io.AbstractReader |
|---|
addAnnotations, canMakeReaderFor, createReader, doWork, getFileParameterForOperator, isMetaDataCacheable, registerOperator, registerReaderDescription, supportsEncoding |
| Methods inherited from class com.rapidminer.tools.AbstractObservable |
|---|
addObserver, addObserverAsFirst, fireUpdate, removeObserver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PARAMETER_FILENAME
public static final java.lang.String PARAMETER_DATAMANAGEMENT
protected static final java.lang.String GENERIC_ERROR_MESSAGE
protected static final java.lang.String UNSPECIFIED_ERROR_MESSAGE
protected static final int LENGTH_BYTE
protected static final int LENGTH_INT_32
protected static final int LENGTH_DOUBLE
| Constructor Detail |
|---|
public BytewiseExampleSource(OperatorDescription description)
| Method Detail |
|---|
public ExampleSet createExampleSet()
throws OperatorException
AbstractExampleSourceOperator.apply().
createExampleSet in class AbstractExampleSourceOperatorExceptionprotected abstract java.lang.String getFileSuffix()
protected abstract ExampleSet readStream(java.io.InputStream inputStream,
DataRowFactory dataRowFactory)
throws java.io.IOException,
UndefinedParameterError
java.io.IOException
UndefinedParameterError
protected int read(java.io.InputStream inputStream,
byte[] buffer,
int length)
throws java.io.IOException
java.io.IOException
protected int read(java.io.InputStream inputStream,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
java.io.IOException
protected int readWithoutLengthCheck(java.io.InputStream inputStream,
byte[] buffer,
int length)
throws java.io.IOException
java.io.IOException
protected int read(java.io.InputStream inputStream,
byte[] buffer,
char divider)
throws java.io.IOException
java.io.IOException
protected int read(java.io.InputStream inputStream,
byte[] buffer,
char[] divider)
throws java.io.IOException
java.io.IOException
protected int extract2ByteInt(byte[] buffer,
int offset,
boolean reverseEndian)
protected int extractInt(byte[] buffer,
int offset,
boolean reverseEndian)
protected float extractFloat(byte[] value,
int offset,
boolean reverseEndian)
protected double extractDouble(byte[] value,
int offset,
boolean reverseEndian)
protected java.lang.String extractString(byte[] value,
int offset,
int length)
public java.util.List<ParameterType> getParameterTypes()
Operator
getParameterTypes in interface ParameterHandlergetParameterTypes in class AbstractReader<ExampleSet>
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||