List of usage examples for com.google.common.primitives UnsignedLong longValue
@Override public long longValue()
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()); }