public class HashUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateMaxFill(int bucketCount,
float fillRatio) |
static int |
computeBucketCount(int expectedSize,
float fillRatio)
uses HashCommon.arraySize() which does this calculation.
|
static int |
nextBucketId(int bucketId,
int mask,
int probe) |
static int |
nextProbeLinear(int probeCount) |
static int |
nextSumOfCount(int probeCount) |
static int |
nextSumOfSquares(int probeCount) |
public static int nextProbeLinear(int probeCount)
public static int nextSumOfCount(int probeCount)
public static int nextSumOfSquares(int probeCount)
public static int nextBucketId(int bucketId,
int mask,
int probe)
bucketId - - previous bucketId locationmask - - mask being used (typically # of buckets-1; due to power-of-2 sized bucket arrays, handles wrap-aroundprobe - - how many buckets to jump to find next bucketpublic static int calculateMaxFill(int bucketCount,
float fillRatio)
public static int computeBucketCount(int expectedSize,
float fillRatio)
expectedSize - - expected number of elements to store in the hashfillRatio - - expected fill ratio of buckets by elemementsCopyright © 2012–2019. All rights reserved.