本文整理了Java中org.openide.nodes.Node.hashCode()
方法的一些代码示例,展示了Node.hashCode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.hashCode()
方法的具体详情如下:
包路径:org.openide.nodes.Node
类名称: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;
}
}
内容来源于网络,如有侵权,请联系作者删除!