本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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});
}
示例11: hashCode
import java.util.Arrays; //導入方法依賴的package包/類
@Override
public int hashCode() {
return Arrays.deepHashCode(new Object[] {providerId, name, nodes, partitions});
}
示例12: TreePathKey
import java.util.Arrays; //導入方法依賴的package包/類
TreePathKey(TreeNode[] _pathToRoot) {
pathToRoot = _pathToRoot;
hashCode = Arrays.deepHashCode(pathToRoot);
}
示例13: hashCode
import java.util.Arrays; //導入方法依賴的package包/類
@Override
public int hashCode() {
return Arrays.deepHashCode(words);
}
示例14: hashCode
import java.util.Arrays; //導入方法依賴的package包/類
@Override
public int hashCode() {
return Arrays.deepHashCode(toArray());
}
示例15: hashCode
import java.util.Arrays; //導入方法依賴的package包/類
@Override
public int hashCode()
{
return Arrays.deepHashCode(data);
}