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

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

本文整理了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

  1. /** Hash by original nodes.
  2. * Note that for subclasses of <code>FilterNode</code>, or filter nodes with non-default children,
  3. * the hash reverts to the identity hash code.
  4. * @return the delegated hash code
  5. */
  6. @Override
  7. public int hashCode() {
  8. try {
  9. assert hashCodeLogging(true) : ""; // NOI18N
  10. int result = isDefault() ? original.hashCode() : System.identityHashCode(this);
  11. assert hashCodeLogging(false) : ""; // NOI18N
  12. return result;
  13. } catch (StackError err) {
  14. err.add(this);
  15. throw err;
  16. }
  17. }

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

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

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

  1. @Override
  2. public boolean equals(Object o) {
  3. Node n = (Node)o;
  4. //Add System.out.println to check the hashcodes
  5. System.out.println(n.hashCode()+"::::::"+this.hashCode());
  6. boolean result = this.x == n.x && this.y == n.y && this.value == n.value;
  7. return result;
  8. }

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

  1. public class NodeFComparator implements Comparator<Node> {
  2. @Override
  3. public int compare(Node arg0, Node arg1) {
  4. int result = arg0.getF() - arg1.getF();
  5. if (result == 0)
  6. return arg0.hashCode() - arg1.hashCode();
  7. return result;
  8. }
  9. }

相关文章