org.apache.sis.util.Utilities.deepHashCode()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(152)

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

Utilities.deepHashCode介绍

[英]Returns a hash code for the specified object, which may be an array. This method returns one of the following values:

  • If the supplied object is null, then this method returns 0.
  • Otherwise if the object is an array of objects, then Arrays#deepHashCode(Object[]) is invoked.
  • Otherwise if the object is an array of primitive type, then the corresponding Arrays#hashCode(double[]) method is invoked.
  • Otherwise Object#hashCode() is invoked.
    This method should be invoked only if the object type is declared exactly as Object, not as some subtype like Object[], String or float[]. In the later cases, use the appropriate Arrays method instead.
    [中]返回指定对象的哈希代码,该对象可能是数组。此方法返回以下值之一:
    *如果提供的对象为null,则此方法返回0。
    *否则,如果对象是对象数组,则调用数组#deepHashCode(object[])。
    *否则,如果对象是基元类型的数组,则调用相应的Arrays#hashCode(double[])方法。
    *否则将调用对象#hashCode()。
    仅当对象类型声明为object,而不是object[]、String或float[]等子类型时,才应调用此方法。在后面的例子中,请使用适当的Arrays方法。

代码示例

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
 * Returns a hash code value for this international text.
 *
 * @return a hash code value for this international text.
 */
@Override
public final int hashCode() {
  return getClass().hashCode() ^ (key + 31*Utilities.deepHashCode(arguments)) ^ (int) serialVersionUID;
}

代码示例来源:origin: apache/sis

/**
 * Returns a hash code value for this international text.
 *
 * @return a hash code value for this international text.
 */
@Override
public final int hashCode() {
  return getClass().hashCode() ^ (key + 31*Utilities.deepHashCode(arguments)) ^ (int) serialVersionUID;
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
 * Returns the hash code value for the given key.
 *
 * @param  key  the key (can not be null).
 */
final int keyHashCode(final Object key) {
  switch (comparisonMode) {
    case IDENTITY:    return System.identityHashCode(key);
    case EQUALS:      return key.hashCode();
    case DEEP_EQUALS: return Utilities.deepHashCode(key);
    default: throw new AssertionError(comparisonMode);
  }
}

代码示例来源:origin: apache/sis

/**
 * Returns the hash code value for the given key.
 *
 * @param  key  the key (can not be null).
 */
final int keyHashCode(final Object key) {
  switch (comparisonMode) {
    case IDENTITY:    return System.identityHashCode(key);
    case EQUALS:      return key.hashCode();
    case DEEP_EQUALS: return Utilities.deepHashCode(key);
    default: throw new AssertionError(comparisonMode);
  }
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
 * Returns a hash code value for this record.
 *
 * @return a hash code value for this record.
 */
@Override
public int hashCode() {
  return Utilities.deepHashCode(values) ^ definition.getRecordType().hashCode();
}

代码示例来源:origin: apache/sis

/**
 * Returns a hash code value for this record.
 *
 * @return a hash code value for this record.
 */
@Override
public int hashCode() {
  return Utilities.deepHashCode(values) ^ definition.getRecordType().hashCode();
}

代码示例来源:origin: org.apache.sis.core/sis-utility

final int hash = (mayContainArrays ? Utilities.deepHashCode(obj) : obj.hashCode()) & HASH_MASK;
int index = hash % table.length;
for (Entry e=table[index]; e!=null; e=(Entry) e.next) {

代码示例来源:origin: apache/sis

final int hash = (mayContainArrays ? Utilities.deepHashCode(obj) : obj.hashCode()) & HASH_MASK;
int index = hash % table.length;
for (Entry e=table[index]; e!=null; e=(Entry) e.next) {

相关文章