} else { int bix = (index >> 1); Bucket newB = new Bucket(symbol, _buckets[bix]); _buckets[bix] = newB; maxColl = Math.max(maxColl, newB.length()); while (b != null) { ++count; String symbol = b.getSymbol(); int index = _hashToIndex(calcHash(symbol)); if (_symbols[index] == null) { } else { int bix = (index >> 1); Bucket newB = new Bucket(symbol, _buckets[bix]); _buckets[bix] = newB; maxColl = Math.max(maxColl, newB.length()); b = b.getNext();
sym = b.find(buffer, start, len); if (sym != null) { return sym; } else { int bix = (index >> 1); Bucket newB = new Bucket(newSymbol, _buckets[bix]); _buckets[bix] = newB; _longestCollisionList = Math.max(newB.length(), _longestCollisionList); if (_longestCollisionList > MAX_COLL_CHAIN_LENGTH) { reportTooManyCollisions(MAX_COLL_CHAIN_LENGTH);
} else { int bix = index >> 1; _buckets[bix] = new Bucket(symbol, _buckets[bix]); while (b != null) { ++count; String symbol = b.getSymbol(); int index = calcHash(symbol) & _indexMask; if (_symbols[index] == null) { } else { int bix = index >> 1; _buckets[bix] = new Bucket(symbol, _buckets[bix]); b = b.getNext();
} else { int bix = index >> 1; _buckets[bix] = new Bucket(symbol, _buckets[bix]); while (b != null) { ++count; String symbol = b.getSymbol(); int index = calcHash(symbol) & _indexMask; if (_symbols[index] == null) { } else { int bix = index >> 1; _buckets[bix] = new Bucket(symbol, _buckets[bix]); b = b.getNext();
public String find(char[] buf, int start, int len) { String sym = _symbol; Bucket b = mNext; while (true) { // Inlined equality comparison: if (sym.length() == len) { int i = 0; do { if (sym.charAt(i) != buf[start+i]) { break; } } while (++i < len); if (i == len) { return sym; } } if (b == null) { break; } sym = b.getSymbol(); b = b.getNext(); } return null; }
public String find(char[] buf, int start, int len) { String sym = _symbol; Bucket b = mNext; while (true) { // Inlined equality comparison: if (sym.length() == len) { int i = 0; do { if (sym.charAt(i) != buf[start+i]) { break; } } while (++i < len); if (i == len) { return sym; } } if (b == null) { break; } sym = b.getSymbol(); b = b.getNext(); } return null; }
} else { int bix = (index >> 1); Bucket newB = new Bucket(symbol, _buckets[bix]); _buckets[bix] = newB; maxColl = Math.max(maxColl, newB.length()); while (b != null) { ++count; String symbol = b.getSymbol(); int index = _hashToIndex(calcHash(symbol)); if (_symbols[index] == null) { } else { int bix = (index >> 1); Bucket newB = new Bucket(symbol, _buckets[bix]); _buckets[bix] = newB; maxColl = Math.max(maxColl, newB.length()); b = b.getNext();
sym = b.find(buffer, start, len); if (sym != null) { return sym; } else { int bix = (index >> 1); Bucket newB = new Bucket(newSymbol, _buckets[bix]); _buckets[bix] = newB; _longestCollisionList = Math.max(newB.length(), _longestCollisionList); if (_longestCollisionList > MAX_COLL_CHAIN_LENGTH) { reportTooManyCollisions(MAX_COLL_CHAIN_LENGTH);
public String find(char[] buf, int start, int len) { String sym = _symbol; Bucket b = _next; while (true) { // Inlined equality comparison: if (sym.length() == len) { int i = 0; do { if (sym.charAt(i) != buf[start+i]) { break; } } while (++i < len); if (i == len) { return sym; } } if (b == null) { break; } sym = b.getSymbol(); b = b.getNext(); } return null; } }
/** * Method mostly needed by unit tests; calculates number of * entries that are in collision list. Value can be at most * ({@link #size} - 1), but should usually be much lower, ideally 0. * * @since 1.9.9 */ public int collisionCount() { int count = 0; for (Bucket bucket : _buckets) { if (bucket != null) { count += bucket.length(); } } return count; }
public String find(char[] buf, int start, int len) { String sym = _symbol; Bucket b = _next; while (true) { // Inlined equality comparison: if (sym.length() == len) { int i = 0; do { if (sym.charAt(i) != buf[start+i]) { break; } } while (++i < len); if (i == len) { return sym; } } if (b == null) { break; } sym = b.getSymbol(); b = b.getNext(); } return null; } }
/** * Method mostly needed by unit tests; calculates number of * entries that are in collision list. Value can be at most * ({@link #size} - 1), but should usually be much lower, ideally 0. * * @since 1.9.9 */ public int collisionCount() { int count = 0; for (Bucket bucket : _buckets) { if (bucket != null) { count += bucket.length(); } } return count; }