public class BlockChunker extends Object
blockSize
) and 64-bits (8-bytes) hash value.
Hash value computed using
Rabin-Karp rolling hash :
usings[0]*31^(blockSize-1) + s[1]*31^(blockSize-2) + ... + s[blockSize-1]
long
arithmetic, where s[i]
is the hash code of String
(which is cached) for statement with number i.
Thus running time - O(N), where N - number of statements.
Implementation fully thread-safe.Constructor and Description |
---|
BlockChunker(int blockSize) |
public BlockChunker(int blockSize)
Copyright © 2009-2012 SonarSource. All Rights Reserved.