Example usage for com.google.common.primitives UnsignedLong longValue

List of usage examples for com.google.common.primitives UnsignedLong longValue

Introduction

In this page you can find the example usage for com.google.common.primitives UnsignedLong longValue.

Prototype

@Override
public long longValue() 

Source Link

Document

Returns the value of this UnsignedLong as a long .

Usage

From source file:com.streametry.jumphash.JumpHash.java

/** Jump Consistent Hashing algorithm
 *
 * @param buckets number of buckets/*from   w w w .ja  v  a 2s. com*/
 * @param keyHash hash of a key
 * @return selected bucket
 */
public static int consistent(int buckets, long keyHash) {

    UnsignedLong key = fromLongBits(keyHash);

    long b = -1, j = 0;
    while (j < buckets) {
        b = j;

        key = key.times(constant).plus(ONE);
        UnsignedLong keyShift = fromLongBits(key.longValue() >>> 33).plus(ONE);

        j = (long) ((b + 1) * (constant2 / keyShift.doubleValue()));
    }

    return (int) b;
}

From source file:org.apache.nifi.processors.evtx.parser.bxml.value.DoubleTypeNode.java

public DoubleTypeNode(BinaryReader binaryReader, ChunkHeader chunkHeader, BxmlNode parent, int length)
        throws IOException {
    super(binaryReader, chunkHeader, parent, length);
    UnsignedLong unsignedLong = binaryReader.readQWord();
    value = Double.longBitsToDouble(unsignedLong.longValue());
}

From source file:org.calrissian.mango.types.encoders.lexi.UnsignedLongEncoder.java

@Override
public String encode(UnsignedLong value) {
    checkNotNull(value, "Null values are not allowed");
    return encodeULong(value.longValue());
}

From source file:org.calrissian.mango.types.encoders.lexi.UnsignedLongReverseEncoder.java

@Override
public String encode(UnsignedLong value) {
    checkNotNull(value, "Null values are not allowed");
    return encodeULong(~value.longValue());
}