public static int combineMultisetHash ( boolean finalize , int ... hashes ) { int hash = 0 ; for ( int h : hashes ) { hash = hash + h ; } if ( finalize ) { hash = combineListHash ( hash ) ; } return hash ; }
Combine many hash codes with an associative commutative hash function . Associativity ensures that the result of this functions can be further combined with other hash codes for getting the same result as if all hash codes had been combined in one step .