本文整理了Java中edu.emory.mathcs.backport.java.util.Arrays.deepHashCode()
方法的一些代码示例,展示了Arrays.deepHashCode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Arrays.deepHashCode()
方法的具体详情如下:
包路径:edu.emory.mathcs.backport.java.util.Arrays
类名称:Arrays
方法名:deepHashCode
暂无
代码示例来源:origin: backport-util-concurrent/backport-util-concurrent
/**
* @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: edu.emory.mathcs.backport/com.springsource.edu.emory.mathcs.backport
/**
* @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: backport-util-concurrent/backport-util-concurrent-java12
/**
* @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;
}
内容来源于网络,如有侵权,请联系作者删除!