Package org.datavec.api.io
Class BinaryComparable
- java.lang.Object
-
- org.datavec.api.io.BinaryComparable
-
- All Implemented Interfaces:
Comparable<BinaryComparable>
- Direct Known Subclasses:
Text
public abstract class BinaryComparable extends Object implements Comparable<BinaryComparable>
-
-
Constructor Summary
Constructors Constructor Description BinaryComparable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(byte[] other, int off, int len)
Compare bytes from {#getBytes()} to those provided.int
compareTo(BinaryComparable other)
Compare bytes from {#getBytes()}.boolean
equals(Object other)
Return true if bytes from {#getBytes()} match.abstract byte[]
getBytes()
Return representative byte array for this instance.abstract int
getLength()
Return n st bytes 0..n-1 from {#getBytes()} are valid.int
hashCode()
Return a hash of the bytes returned from {#getBytes()}.
-
-
-
Method Detail
-
getLength
public abstract int getLength()
Return n st bytes 0..n-1 from {#getBytes()} are valid.
-
getBytes
public abstract byte[] getBytes()
Return representative byte array for this instance.
-
compareTo
public int compareTo(BinaryComparable other)
Compare bytes from {#getBytes()}.- Specified by:
compareTo
in interfaceComparable<BinaryComparable>
- See Also:
org.apache.hadoop.io.WritableComparator#compareBytes(byte[],int,int,byte[],int,int)
-
compareTo
public int compareTo(byte[] other, int off, int len)
Compare bytes from {#getBytes()} to those provided.
-
equals
public boolean equals(Object other)
Return true if bytes from {#getBytes()} match.
-
-