Package org.datavec.api.formats.input
Class BaseInputFormat
- java.lang.Object
-
- org.datavec.api.formats.input.BaseInputFormat
-
- All Implemented Interfaces:
Serializable
,InputFormat
,Writable
- Direct Known Subclasses:
CSVInputFormat
,LibSvmInputFormat
,LineInputFormat
,MatlabInputFormat
,SVMLightInputFormat
public abstract class BaseInputFormat extends Object implements InputFormat
- Author:
- Adam Gibson
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseInputFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordReader
createReader(InputSplit split)
Creates a reader from an input splitWritableType
getType()
Get the type of the writable.void
readFields(DataInput in)
Deserialize the fields of this object fromin
.double
toDouble()
Convert Writable to double.float
toFloat()
Convert Writable to float.int
toInt()
Convert Writable to int.long
toLong()
Convert Writable to long.void
write(DataOutput out)
Serialize the fields of this object toout
.void
writeType(DataOutput out)
Write the type (a single short value) to the DataOutput.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.datavec.api.formats.input.InputFormat
createReader
-
-
-
-
Method Detail
-
createReader
public RecordReader createReader(InputSplit split) throws IOException, InterruptedException
Description copied from interface:InputFormat
Creates a reader from an input split- Specified by:
createReader
in interfaceInputFormat
- Parameters:
split
- the split to read- Returns:
- the reader from the given input split
- Throws:
IOException
InterruptedException
-
write
public void write(DataOutput out) throws IOException
Description copied from interface:Writable
Serialize the fields of this object toout
.- Specified by:
write
in interfaceWritable
- Parameters:
out
-DataOuput
to serialize this object into.- Throws:
IOException
-
readFields
public void readFields(DataInput in) throws IOException
Description copied from interface:Writable
Deserialize the fields of this object fromin
.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFields
in interfaceWritable
- Parameters:
in
-DataInput
to deseriablize this object from.- Throws:
IOException
-
toDouble
public double toDouble()
Description copied from interface:Writable
Convert Writable to double. Whether this is supported depends on the specific writable.
-
toFloat
public float toFloat()
Description copied from interface:Writable
Convert Writable to float. Whether this is supported depends on the specific writable.
-
toInt
public int toInt()
Description copied from interface:Writable
Convert Writable to int. Whether this is supported depends on the specific writable.
-
toLong
public long toLong()
Description copied from interface:Writable
Convert Writable to long. Whether this is supported depends on the specific writable.
-
writeType
public void writeType(DataOutput out) throws IOException
Description copied from interface:Writable
Write the type (a single short value) to the DataOutput. SeeWritableFactory
for details.- Specified by:
writeType
in interfaceWritable
- Parameters:
out
- DataOutput to write to- Throws:
IOException
- For errors during writing
-
getType
public WritableType getType()
Description copied from interface:Writable
Get the type of the writable.
-
-