java.lang.Integer.rotateLeft()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中java.lang.Integer.rotateLeft()方法的一些代码示例,展示了Integer.rotateLeft()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Integer.rotateLeft()方法的具体详情如下:
包路径:java.lang.Integer
类名称:Integer
方法名:rotateLeft

Integer.rotateLeft介绍

[英]Rotates the bits of the specified integer to the left by the specified number of bits.
[中]将指定整数的位向左旋转指定位数。

代码示例

代码示例来源:origin: google/guava

  1. private static int mixH1(int h1, int k1) {
  2. h1 ^= k1;
  3. h1 = Integer.rotateLeft(h1, 13);
  4. h1 = h1 * 5 + 0xe6546b64;
  5. return h1;
  6. }

代码示例来源:origin: google/guava

  1. private static int mixK1(int k1) {
  2. k1 *= C1;
  3. k1 = Integer.rotateLeft(k1, 15);
  4. k1 *= C2;
  5. return k1;
  6. }

代码示例来源:origin: google/guava

  1. static int smear(int hashCode) {
  2. return C2 * Integer.rotateLeft(hashCode * C1, 15);
  3. }

代码示例来源:origin: google/guava

  1. static int smear(int hashCode) {
  2. return (int) (C2 * Integer.rotateLeft((int) (hashCode * C1), 15));
  3. }

代码示例来源:origin: prestodb/presto

  1. private static int mixK1(int k1)
  2. {
  3. k1 *= C1;
  4. k1 = Integer.rotateLeft(k1, 15);
  5. k1 *= C2;
  6. return k1;
  7. }

代码示例来源:origin: prestodb/presto

  1. private static int mixH1(int h1, int k1)
  2. {
  3. h1 ^= k1;
  4. h1 = Integer.rotateLeft(h1, 13);
  5. h1 = h1 * 5 + 0xe6546b64;
  6. return h1;
  7. }

代码示例来源:origin: prestodb/presto

  1. private static int mixH1(int h1, int k1) {
  2. h1 ^= k1;
  3. h1 = Integer.rotateLeft(h1, 13);
  4. h1 = h1 * 5 + 0xe6546b64;
  5. return h1;
  6. }

代码示例来源:origin: clojure/clojure

  1. private static int mixK1(int k1){
  2. k1 *= C1;
  3. k1 = Integer.rotateLeft(k1, 15);
  4. k1 *= C2;
  5. return k1;
  6. }

代码示例来源:origin: clojure/clojure

  1. private static int mixH1(int h1, int k1){
  2. h1 ^= k1;
  3. h1 = Integer.rotateLeft(h1, 13);
  4. h1 = h1 * 5 + 0xe6546b64;
  5. return h1;
  6. }

代码示例来源:origin: prestodb/presto

  1. private static int mixK1(int k1) {
  2. k1 *= C1;
  3. k1 = Integer.rotateLeft(k1, 15);
  4. k1 *= C2;
  5. return k1;
  6. }

代码示例来源:origin: redisson/redisson

  1. /**
  2. * Smear hash code.
  3. */
  4. public static int smear(int hashCode) {
  5. return C2 * Integer.rotateLeft(hashCode * C1, 15);
  6. }

代码示例来源:origin: apache/incubator-druid

  1. /**
  2. * This method was rewritten in Java from an intermediate step of the Murmur hash function in
  3. * https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp, which contained the
  4. * following header:
  5. *
  6. * MurmurHash3 was written by Austin Appleby, and is placed in the public domain. The author
  7. * hereby disclaims copyright to this source code.
  8. */
  9. static int smear(int hashCode)
  10. {
  11. return C2 * Integer.rotateLeft(hashCode * C1, 15);
  12. }

代码示例来源:origin: prestodb/presto

  1. static int smear(int hashCode) {
  2. return C2 * Integer.rotateLeft(hashCode * C1, 15);
  3. }

代码示例来源:origin: prestodb/presto

  1. static int smear(int hashCode) {
  2. return (int) (C2 * Integer.rotateLeft((int) (hashCode * C1), 15));
  3. }

代码示例来源:origin: google/j2objc

  1. private static int mixH1(int h1, int k1) {
  2. h1 ^= k1;
  3. h1 = Integer.rotateLeft(h1, 13);
  4. h1 = h1 * 5 + 0xe6546b64;
  5. return h1;
  6. }

代码示例来源:origin: google/j2objc

  1. private static int mixK1(int k1) {
  2. k1 *= C1;
  3. k1 = Integer.rotateLeft(k1, 15);
  4. k1 *= C2;
  5. return k1;
  6. }

代码示例来源:origin: spring-projects/spring-framework

  1. @Override
  2. public int hashCode() {
  3. return name.hashCode()
  4. ^ Integer.rotateLeft(descriptor.hashCode(), 8)
  5. ^ Integer.rotateLeft(bootstrapMethod.hashCode(), 16)
  6. ^ Integer.rotateLeft(Arrays.hashCode(bootstrapMethodArguments), 24);
  7. }

代码示例来源:origin: stanfordnlp/CoreNLP

  1. @Override
  2. public int hashCode() {
  3. /* I'm not sure why this is happening, and i really don't want to
  4. spend a month tracing it down. -wmorgan. */
  5. //if (val == null) return num << 16 ^ 1 << 5 ^ tag.hashCode();
  6. //return num << 16 ^ val.hashCode() << 5 ^ tag.hashCode();
  7. if (hashCode == 0) {
  8. int hNum = Integer.rotateLeft(num,16);
  9. int hVal = Integer.rotateLeft(val.hashCode(),5);
  10. hashCode = hNum ^ hVal ^ tag.hashCode();
  11. }
  12. return hashCode;
  13. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. public int hashCode() {
  3. return name.hashCode()
  4. ^ Integer.rotateLeft(descriptor.hashCode(), 8)
  5. ^ Integer.rotateLeft(bootstrapMethod.hashCode(), 16)
  6. ^ Integer.rotateLeft(Arrays.hashCode(bootstrapMethodArguments), 24);
  7. }

代码示例来源:origin: clojure/clojure

  1. @Override
  2. public int hashCode() {
  3. return name.hashCode()
  4. ^ Integer.rotateLeft(descriptor.hashCode(), 8)
  5. ^ Integer.rotateLeft(bootstrapMethod.hashCode(), 16)
  6. ^ Integer.rotateLeft(Arrays.hashCode(bootstrapMethodArguments), 24);
  7. }

相关文章