Package org.datavec.api.writable
Interface Writable
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
InputFormat
,WritableComparable<T>
- All Known Implementing Classes:
ArrayWritable
,BaseInputFormat
,BooleanWritable
,BytesWritable
,ByteWritable
,Configuration
,CSVInputFormat
,DoubleWritable
,FloatWritable
,IntWritable
,LibSvmInputFormat
,LineInputFormat
,ListStringInputFormat
,LongWritable
,MatlabInputFormat
,NDArrayWritable
,NullWritable
,SVMLightInputFormat
,Text
public interface Writable extends Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WritableType
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.
-
-
-
Method Detail
-
write
void write(DataOutput out) throws IOException
Serialize the fields of this object toout
.- Parameters:
out
-DataOuput
to serialize this object into.- Throws:
IOException
-
readFields
void readFields(DataInput in) throws IOException
Deserialize the fields of this object fromin
.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Parameters:
in
-DataInput
to deseriablize this object from.- Throws:
IOException
-
writeType
void writeType(DataOutput out) throws IOException
Write the type (a single short value) to the DataOutput. SeeWritableFactory
for details.- Parameters:
out
- DataOutput to write to- Throws:
IOException
- For errors during writing
-
toDouble
double toDouble()
Convert Writable to double. Whether this is supported depends on the specific writable.
-
toFloat
float toFloat()
Convert Writable to float. Whether this is supported depends on the specific writable.
-
toInt
int toInt()
Convert Writable to int. Whether this is supported depends on the specific writable.
-
toLong
long toLong()
Convert Writable to long. Whether this is supported depends on the specific writable.
-
getType
WritableType getType()
Get the type of the writable.- Returns:
-
-