private String addSymbol0(char[] buffer, int offset, int length, int bucket, int collisionCount) { if (fCount >= fThreshold) { // Rehash the table if the threshold is exceeded rehash(); bucket = hash(buffer, offset, length) % fTableSize; } else if (collisionCount >= fCollisionThreshold) { // Select a new hash function and rehash the table if // the collision threshold is exceeded. rebalance(); bucket = hash(buffer, offset, length) % fTableSize; } // add new entry String symbol = new String(buffer, offset, length).intern(); SREntry entry = new SREntry(symbol, buffer, offset, length, fBuckets[bucket], bucket, fReferenceQueue); fBuckets[bucket] = entry; ++fCount; return symbol; } // addSymbol0(char[],int,int,int,int):String
private String addSymbol0(String symbol, int bucket, int collisionCount) { if (fCount >= fThreshold) { // Rehash the table if the threshold is exceeded rehash(); bucket = hash(symbol) % fTableSize; } else if (collisionCount >= fCollisionThreshold) { // Select a new hash function and rehash the table if // the collision threshold is exceeded. rebalance(); bucket = hash(symbol) % fTableSize; } // add new entry symbol = symbol.intern(); SREntry entry = new SREntry(symbol, fBuckets[bucket], bucket, fReferenceQueue); fBuckets[bucket] = entry; ++fCount; return symbol; } // addSymbol0(String,int,int):String