Package org.datavec.api.writable
Class BooleanWritable
- java.lang.Object
-
- org.datavec.api.writable.BooleanWritable
-
- All Implemented Interfaces:
Serializable,Comparable,WritableComparable,Writable
public class BooleanWritable extends Object implements WritableComparable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBooleanWritable.ComparatorA Comparator optimized for BooleanWritable.
-
Constructor Summary
Constructors Constructor Description BooleanWritable()BooleanWritable(boolean value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object o)booleanequals(Object o)booleanget()Returns the value of the BooleanWritableWritableTypegetType()Get the type of the writable.inthashCode()voidreadFields(DataInput in)Deserialize the fields of this object fromin.voidset(boolean value)Set the value of the BooleanWritabledoubletoDouble()Convert Writable to double.floattoFloat()Convert Writable to float.inttoInt()Convert Writable to int.longtoLong()Convert Writable to long.StringtoString()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
-
set
public void set(boolean value)
Set the value of the BooleanWritable
-
get
public boolean get()
Returns the value of the BooleanWritable
-
readFields
public void readFields(DataInput in) throws IOException
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException
-
writeType
public void writeType(DataOutput out) throws IOException
Description copied from interface:WritableWrite the type (a single short value) to the DataOutput. SeeWritableFactoryfor details.- Specified by:
writeTypein interfaceWritable- Parameters:
out- DataOutput to write to- Throws:
IOException- For errors during writing
-
write
public void write(DataOutput out) throws IOException
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException
-
compareTo
public int compareTo(Object o)
- Specified by:
compareToin interfaceComparable
-
toDouble
public double toDouble()
Description copied from interface:WritableConvert Writable to double. Whether this is supported depends on the specific writable.
-
toFloat
public float toFloat()
Description copied from interface:WritableConvert Writable to float. Whether this is supported depends on the specific writable.
-
toInt
public int toInt()
Description copied from interface:WritableConvert Writable to int. Whether this is supported depends on the specific writable.
-
toLong
public long toLong()
Description copied from interface:WritableConvert Writable to long. Whether this is supported depends on the specific writable.
-
getType
public WritableType getType()
Description copied from interface:WritableGet the type of the writable.
-
-