private void addHash(long hash) { short value = minhash.get(hash); if (value < Short.MAX_VALUE) { minhash.put(hash, (short) (value + 1)); } while (minhash.size() > maxHashes) { minhash.remove(minhash.lastLongKey()); } }
public void mergeWith(SetDigest other) { hll.mergeWith(other.hll); LongBidirectionalIterator iterator = other.minhash.keySet().iterator(); while (iterator.hasNext()) { long key = iterator.nextLong(); int count = minhash.get(key) + other.minhash.get(key); minhash.put(key, Shorts.saturatedCast(count)); } while (minhash.size() > maxHashes) { minhash.remove(minhash.lastLongKey()); } }
@Override public long lastLongKey() { return sortedMap.lastLongKey(); } /**
@Override public long lastLongKey() { synchronized (sync) { return sortedMap.lastLongKey(); } } /**
/** * {@inheritDoc} * * @deprecated Please use the corresponding type-specific method instead. */ @Deprecated @Override default Long lastKey() { return Long.valueOf(lastLongKey()); } /**
private void addHash(long hash) { short value = minhash.get(hash); if (value < Short.MAX_VALUE) { minhash.put(hash, (short) (value + 1)); } while (minhash.size() > maxHashes) { minhash.remove(minhash.lastLongKey()); } }
private void addHash(long hash) { short value = minhash.get(hash); if (value < Short.MAX_VALUE) { minhash.put(hash, (short) (value + 1)); } while (minhash.size() > maxHashes) { minhash.remove(minhash.lastLongKey()); } }
public void mergeWith(SetDigest other) { hll.mergeWith(other.hll); LongBidirectionalIterator iterator = other.minhash.keySet().iterator(); while (iterator.hasNext()) { long key = iterator.nextLong(); int count = minhash.get(key) + other.minhash.get(key); minhash.put(key, Shorts.saturatedCast(count)); } while (minhash.size() > maxHashes) { minhash.remove(minhash.lastLongKey()); } }
public void mergeWith(SetDigest other) { hll.mergeWith(other.hll); LongBidirectionalIterator iterator = other.minhash.keySet().iterator(); while (iterator.hasNext()) { long key = iterator.nextLong(); int count = minhash.get(key) + other.minhash.get(key); minhash.put(key, Shorts.saturatedCast(count)); } while (minhash.size() > maxHashes) { minhash.remove(minhash.lastLongKey()); } }