scala.actors.threadpool.Arrays.hashCode()方法的使用及代码示例

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

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

Arrays.hashCode介绍

暂无

代码示例

代码示例来源:origin: org.scala-lang/scala-actors

/**
 * @since 1.5
 */
public static int deepHashCode(Object a[]) {
  if (a == null) return 0;
  int hash = 1;
  for (int i=0; i<a.length; i++) {
    Object e = a[i];
    hash = 31*hash +
        (e instanceof Object[]  ? deepHashCode((Object[])e) :
        (e instanceof byte[]    ? hashCode((byte[])e) :
        (e instanceof short[]   ? hashCode((short[])e) :
        (e instanceof int[]     ? hashCode((int[])e) :
        (e instanceof long[]    ? hashCode((long[])e) :
        (e instanceof char[]    ? hashCode((char[])e) :
        (e instanceof boolean[] ? hashCode((boolean[])e) :
        (e instanceof float[]   ? hashCode((float[])e) :
        (e instanceof double[]  ? hashCode((double[])e) :
        (e != null              ? e.hashCode() : 0))))))))));
  }
  return hash;
}

代码示例来源:origin: org.scala-lang.virtualized/scala-actors

/**
 * @since 1.5
 */
public static int deepHashCode(Object a[]) {
  if (a == null) return 0;
  int hash = 1;
  for (int i=0; i<a.length; i++) {
    Object e = a[i];
    hash = 31*hash +
        (e instanceof Object[]  ? deepHashCode((Object[])e) :
        (e instanceof byte[]    ? hashCode((byte[])e) :
        (e instanceof short[]   ? hashCode((short[])e) :
        (e instanceof int[]     ? hashCode((int[])e) :
        (e instanceof long[]    ? hashCode((long[])e) :
        (e instanceof char[]    ? hashCode((char[])e) :
        (e instanceof boolean[] ? hashCode((boolean[])e) :
        (e instanceof float[]   ? hashCode((float[])e) :
        (e instanceof double[]  ? hashCode((double[])e) :
        (e != null              ? e.hashCode() : 0))))))))));
  }
  return hash;
}

相关文章