當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。