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 WritableTypegetType()Get the type of the writable.voidreadFields(DataInput in)Deserialize the fields of this object fromin.doubletoDouble()Convert Writable to double.floattoFloat()Convert Writable to float.inttoInt()Convert Writable to int.longtoLong()Convert Writable to long.voidwrite(DataOutput out)Serialize the fields of this object toout.voidwriteType(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-DataOuputto 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-DataInputto deseriablize this object from.- Throws:
IOException
-
writeType
void writeType(DataOutput out) throws IOException
Write the type (a single short value) to the DataOutput. SeeWritableFactoryfor 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:
-
-