Example usage for org.apache.hadoop.io WritableComparator readDouble

List of usage examples for org.apache.hadoop.io WritableComparator readDouble

Introduction

In this page you can find the example usage for org.apache.hadoop.io WritableComparator readDouble.

Prototype

public static double readDouble(byte[] bytes, int start) 

Source Link

Document

Parse a double from a byte array.

Usage

From source file:org.apache.mrql.MR_double.java

License:Apache License

final public static int compare(byte[] x, int xs, int xl, byte[] y, int ys, int yl, int[] size) {
    size[0] = (Double.SIZE >> 3) + 1;
    double v = WritableComparator.readDouble(x, xs) - WritableComparator.readDouble(y, ys);
    return (v == 0) ? 0 : ((v > 0) ? 1 : -1);
}