当前位置: 首页>>代码示例>>Java>>正文


Java Arrays.deepHashCode方法代码示例

本文整理汇总了Java中java.util.Arrays.deepHashCode方法的典型用法代码示例。如果您正苦于以下问题:Java Arrays.deepHashCode方法的具体用法?Java Arrays.deepHashCode怎么用?Java Arrays.deepHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Arrays的用法示例。


在下文中一共展示了Arrays.deepHashCode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
/**
 * Returns the hash code value for this <code>CompositeDataSupport</code> instance.
 * <p>
 * The hash code of a <code>CompositeDataSupport</code> instance is the sum of the hash codes
 * of all elements of information used in <code>equals</code> comparisons
 * (ie: its <i>composite type</i> and all the item values).
 * <p>
 * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
 * for any two <code>CompositeDataSupport</code> instances <code>t1</code> and <code>t2</code>,
 * as required by the general contract of the method
 * {@link Object#hashCode() Object.hashCode()}.
 * <p>
 * Each item value's hash code is added to the returned hash code.
 * If an item value is an array,
 * its hash code is obtained as if by calling the
 * {@link java.util.Arrays#deepHashCode(Object[]) deepHashCode} method
 * for arrays of object reference types or the appropriate overloading
 * of {@code Arrays.hashCode(e)} for arrays of primitive types.
 *
 * @return the hash code value for this <code>CompositeDataSupport</code> instance
 */
@Override
public int hashCode() {
    int hashcode = compositeType.hashCode();

    for (Object o : contents.values()) {
        if (o instanceof Object[])
            hashcode += Arrays.deepHashCode((Object[]) o);
        else if (o instanceof byte[])
            hashcode += Arrays.hashCode((byte[]) o);
        else if (o instanceof short[])
            hashcode += Arrays.hashCode((short[]) o);
        else if (o instanceof int[])
            hashcode += Arrays.hashCode((int[]) o);
        else if (o instanceof long[])
            hashcode += Arrays.hashCode((long[]) o);
        else if (o instanceof char[])
            hashcode += Arrays.hashCode((char[]) o);
        else if (o instanceof float[])
            hashcode += Arrays.hashCode((float[]) o);
        else if (o instanceof double[])
            hashcode += Arrays.hashCode((double[]) o);
        else if (o instanceof boolean[])
            hashcode += Arrays.hashCode((boolean[]) o);
        else if (o != null)
            hashcode += o.hashCode();
    }

    return hashcode;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:51,代码来源:CompositeDataSupport.java

示例2: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
    int hash = 7;
    hash = 89 * hash + Arrays.deepHashCode(this.file);
    hash = 89 * hash + this.index;
    return hash;
}
 
开发者ID:VISNode,项目名称:VISNode,代码行数:8,代码来源:MultiFileInput.java

示例3: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
    int hash = 5;
    hash = 41 * hash + Objects.hashCode(this.typename);
    hash = 41 * hash + Arrays.deepHashCode(this.params);
    return hash;
}
 
开发者ID:Loara,项目名称:Meucci,代码行数:8,代码来源:TypeDich.java

示例4: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
    int hash = 5;
    hash = 79 * hash + Arrays.deepHashCode(this.keys);
    hash = 79 * hash + (this.handle != null ? this.handle.hashCode() : 0);
    hash = 79 * hash + (this.file != null ? this.file.hashCode() : 0);
    return hash;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ErrorDescriptionFactory.java

示例5: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
    int hash = 7;
    hash = 71 * hash + Arrays.deepHashCode(this.cmd);
    hash = 71 * hash + (this.wait ? 1 : 0);
    return hash;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:JShellTool.java

示例6: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
    int hash = 7;
    hash = 79 * hash + this.stackID;
    hash = 79 * hash + (this.category != null ? this.category.hashCode() : 0);
    hash = 79 * hash + Arrays.deepHashCode(this.args);
    return hash;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:RemoteMeasurements.java

示例7: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
    int hash = 5;
    hash = 89 * hash + Arrays.deepHashCode(this.methods);
    hash = 89 * hash + Arrays.hashCode(this.enabled);
    return hash;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:Authentication.java

示例8: deepHashCode0

import java.util.Arrays; //导入方法依赖的package包/类
private static int deepHashCode0(Object o) {
    if (o == null) {
        return 0;
    } else if (!o.getClass().isArray()) {
        return o.hashCode();
    } else if (o instanceof Object[]) {
        return Arrays.deepHashCode((Object[]) o);
    } else if (o instanceof byte[]) {
        return Arrays.hashCode((byte[]) o);
    } else if (o instanceof short[]) {
        return Arrays.hashCode((short[]) o);
    } else if (o instanceof int[]) {
        return Arrays.hashCode((int[]) o);
    } else if (o instanceof long[]) {
        return Arrays.hashCode((long[]) o);
    } else if (o instanceof char[]) {
        return Arrays.hashCode((char[]) o);
    } else if (o instanceof float[]) {
        return Arrays.hashCode((float[]) o);
    } else if (o instanceof double[]) {
        return Arrays.hashCode((double[]) o);
    } else if (o instanceof boolean[]) {
        return Arrays.hashCode((boolean[]) o);
    } else {
        throw shouldNotReachHere();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:NodeClass.java

示例9: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
  int result = Arrays.hashCode(_lightSet);
  result = 31 * result + Arrays.hashCode(_lightTypes);
  result = 31 * result + Arrays.deepHashCode(_ambients);
  result = 31 * result + Arrays.deepHashCode(_speculars);
  result = 31 * result + Arrays.deepHashCode(_diffuses);
  result = 31 * result + Arrays.deepHashCode(_positions);
  return result;
}
 
开发者ID:MinesJTK,项目名称:jtk,代码行数:11,代码来源:OrbitViewLighting.java

示例10: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public synchronized int hashCode() {
  // need to be deep as counters is an array
  return Arrays.deepHashCode(new Object[]{enumClass, counters, displayName});
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:FrameworkCounterGroup.java

示例11: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
    return Arrays.deepHashCode(new Object[] {providerId, name, nodes, partitions});
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:ClusterMetadata.java

示例12: TreePathKey

import java.util.Arrays; //导入方法依赖的package包/类
TreePathKey(TreeNode[] _pathToRoot) {
    pathToRoot = _pathToRoot;
    hashCode = Arrays.deepHashCode(pathToRoot);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ProfilerTreeTable.java

示例13: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
	return Arrays.deepHashCode(words);
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:5,代码来源:NGram.java

示例14: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode() {
    return Arrays.deepHashCode(toArray());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:ResultRecord.java

示例15: hashCode

import java.util.Arrays; //导入方法依赖的package包/类
@Override
public int hashCode()
{
	return Arrays.deepHashCode(data);
}
 
开发者ID:timtomtim7,项目名称:SparseBukkitAPI,代码行数:6,代码来源:Matrix4f.java


注:本文中的java.util.Arrays.deepHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。