public int spilloverQuadCount() { // difference between spillover end, start, divided by 4 (four ints per slot) return (_spilloverEnd - _spilloverStart()) >> 2; }
private int _findTertiary(int origOffset, int q1, int q2) { int offset = _tertiaryStart + ((origOffset >> (_tertiaryShift + 2)) << _tertiaryShift); final int[] hashArea = _hashArea; final int bucketSize = (1 << _tertiaryShift); for (int end = offset + bucketSize; offset < end; offset += 4) { int lenAndIndex = hashArea[offset+3]; if ((q1 == hashArea[offset]) && (q2 == hashArea[offset+1]) && (2 == (lenAndIndex & 0xFFFF))) { return lenAndIndex >> 16; } if (lenAndIndex == 0) { return -1; } } for (offset = _spilloverStart(); offset < _spilloverEnd; offset += 4) { if ((q1 == hashArea[offset]) && (q2 == hashArea[offset+1])) { int lenAndIndex = hashArea[offset+3]; if (2 == (lenAndIndex & 0xFFFF)) { return lenAndIndex >> 16; } } } return -1; }
private int _findTertiary(int origOffset, int q1, int q2, int q3) { int offset = _tertiaryStart + ((origOffset >> (_tertiaryShift + 2)) << _tertiaryShift); final int[] hashArea = _hashArea; final int bucketSize = (1 << _tertiaryShift); for (int end = offset + bucketSize; offset < end; offset += 4) { int lenAndIndex = hashArea[offset+3]; if ((q1 == hashArea[offset]) && (q2 == hashArea[offset+1]) && (q3 == hashArea[offset+2]) && (3 == (lenAndIndex & 0xFFFF))) { return lenAndIndex >> 16; } if (lenAndIndex == 0) { return -1; } } for (offset = _spilloverStart(); offset < _spilloverEnd; offset += 4) { if ((q1 == hashArea[offset]) && (q2 == hashArea[offset+1]) && (q3 == hashArea[offset+2])) { int lenAndIndex = hashArea[offset+3]; if (3 == (lenAndIndex & 0xFFFF)) { return lenAndIndex >> 16; } } } return -1; }
for (offset = _spilloverStart(); offset < _spilloverEnd; offset += 4) { if (q1 == hashArea[offset]) { int lenAndIndex = hashArea[offset+3];
private int _findTertiary(int origOffset, int hash, int[] q, int qlen) { int offset = _tertiaryStart + ((origOffset >> (_tertiaryShift + 2)) << _tertiaryShift); final int[] hashArea = _hashArea; final int bucketSize = (1 << _tertiaryShift); for (int end = offset + bucketSize; offset < end; offset += 4) { int lenAndIndex = hashArea[offset+3]; if ((hash == hashArea[offset]) && (qlen == (lenAndIndex & 0xFFFF))) { if (_verifyLongName(q, qlen, hashArea[offset+1])) { return lenAndIndex >> 16; } } if (lenAndIndex == 0) { return -1; } } for (offset = _spilloverStart(); offset < _spilloverEnd; offset += 4) { if (hash == hashArea[offset]) { int lenAndIndex = hashArea[offset+3]; if ((qlen == (lenAndIndex & 0xFFFF)) && _verifyLongName(q, qlen, hashArea[offset+1])) { return lenAndIndex >> 16; } } } return -1; }