org.jdom.Namespace.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(0.9k)|赞(0)|评价(0)|浏览(97)

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

Namespace.hashCode介绍

[英]This returns a probably unique hash code for the Namespace. If two namespaces have the same URI, they are equal and have the same hash code, even if they have different prefixes.
[中]这将为Namespace返回一个可能唯一的哈希代码。如果两个名称空间具有相同的URI,则它们相等且具有相同的哈希代码,即使它们的前缀不同。

代码示例

代码示例来源:origin: org.jdom/jdom-legacy

public int hashCode() {
  // Generated by IntelliJ
  int result;
  result = (name != null ? name.hashCode() : 0);
  result = 29 * result + (namespace != null ? namespace.hashCode() : 0);
  return result;
}

代码示例来源:origin: org.rometools/rome-modules

public int hashCode() {
  int hash = 7;
  hash = 61 * hash + (this.element != null ? this.element.hashCode() : 0);
  hash = 61 * hash + (this.label != null ? this.label.hashCode() : 0);
  hash = 61 * hash + (this.namespace != null ? this.namespace.hashCode() : 0);
  return hash;
}

相关文章