privateinthash(Object k) {int h = hashSeed;if ((0!= h) && (k instanceof String)) {returnsun.misc.Hashing.stringHash32((String) k); } h ^=k.hashCode();// Spread bits to regularize both segment and index locations,// using variant of single-word Wang/Jenkins hash. h += (h <<15) ^0xffffcd7d; h ^= (h >>>10); h += (h <<3); h ^= (h >>>6); h += (h <<2) + (h <<14);return h ^ (h >>>16);}int j = (hash >>> segmentShift) & segmentMask;
privateinthash(Object k) {// 简单进行hash,并取其hashCode// hashSeed will be zero if alternative hashing is disabled.return hashSeed ^k.hashCode();}// 没有单独的 indexOf() 只有下面的:// 和 0x7FFFFFFF 进行与操作是为了避免出现负数求模int index = (hash &0x7FFFFFFF) %tab.length;