org.openide.nodes.Node.hashCode()方法的使用及代码示例

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

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

Node.hashCode介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

/** Hash by original nodes.
* Note that for subclasses of <code>FilterNode</code>, or filter nodes with non-default children,
* the hash reverts to the identity hash code.
* @return the delegated hash code
*/
@Override
public int hashCode() {
  try {
    assert hashCodeLogging(true) : ""; // NOI18N
    int result = isDefault() ? original.hashCode() : System.identityHashCode(this);
    assert hashCodeLogging(false) : ""; // NOI18N
    return result;
  } catch (StackError err) {
    err.add(this);
    throw err;
  }
}

代码示例来源:origin: eu.limetri.client/mapviewer-nb-swing

@Override
  public int hashCode() {
    int hash = 5;
    hash = 17 * hash + (this.layerNode != null ? this.layerNode.hashCode() : 0);
    return hash;
  }
}

代码示例来源:origin: stackoverflow.com

@Override
public boolean equals(Object o) {
  Node n = (Node)o;
  //Add System.out.println to check the hashcodes
  System.out.println(n.hashCode()+"::::::"+this.hashCode());

  boolean result = this.x == n.x && this.y == n.y && this.value == n.value;
  return result;
}

代码示例来源:origin: stackoverflow.com

public class NodeFComparator implements Comparator<Node> {
  @Override
  public int compare(Node arg0, Node arg1) {
    int result = arg0.getF() - arg1.getF();
    if (result == 0)
      return arg0.hashCode() - arg1.hashCode();
    return result;
  }
}

相关文章

微信公众号

最新文章

更多