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

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

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

@Override
public int hashCode() {
  return Utilities.deepHashCode(this.values);
}

代码示例来源:origin: org.geotools/gt-coverage

@Override
public int hashCode() {
  return Utilities.deepHashCode(this.values);
}

代码示例来源:origin: org.geoserver.community/gs-monitor-hibernate

public int hashCode(Object x) throws HibernateException {
  return Utilities.deepHashCode(x);
}

代码示例来源:origin: org.geotools/gt-render

@Override
public int hashCode() {
  if(hashCode<0)
  {
    int result =Utilities.deepHashCode( elements );
    result=Utilities.deepHashCode( minimums );
    result=Utilities.hash( getName(),result );
    hashCode=Utilities.hash(getApproximateDomainRange(),hashCode );
  }
  return hashCode;
}

相关文章