Class BinaryComparable

    • Constructor Detail

      • BinaryComparable

        public BinaryComparable()
    • 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 interface Comparable<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.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Return a hash of the bytes returned from {#getBytes()}.
        Overrides:
        hashCode in class Object
        See Also:
        org.apache.hadoop.io.WritableComparator#hashBytes(byte[],int)