本文整理了Java中org.openide.nodes.Node.equals()
方法的一些代码示例,展示了Node.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.equals()
方法的具体详情如下:
包路径:org.openide.nodes.Node
类名称:Node
方法名:equals
[英]Compares for equaliness. Does special treatment of FilterNodes. If argument is FilterNode then this node can be equal with it if it is its original.
[中]比较平等。对过滤器节点进行特殊处理。如果参数是FilterNode,那么如果该节点是其原始节点,则该节点可以与其相等。
代码示例来源:origin: org.netbeans.api/org-openide-nodes
/** Get the index of a node. Simply scans through the array returned by {@link #getNodes}.
* @param node the node
* @return the index, or <code>-1</code> if the node was not found
*/
public int indexOf(final Node node) {
Node[] arr = getNodes();
for (int i = 0; i < arr.length; i++) {
if (node.equals(arr[i])) {
return i;
}
}
return -1;
}
代码示例来源:origin: org.netbeans.api/org-openide-nodes
return left.equals(right);
代码示例来源:origin: org.netbeans.api/org-openide-nodes
if (newNode.equals(oldNode)) {
代码示例来源:origin: org.netbeans.api/org-openide-explorer
private int rowForNode(Node node) {
for (int i = 0; i < nodeRows.length; i++) {
if (node.equals(nodeRows[i])) {
return i;
}
}
return -1;
}
代码示例来源:origin: stackoverflow.com
for (final Node temp : edges.get(current)){
if(temp.equals(node2)){
return true;
} else {
stack.push(temp);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-bugtracking-commons
private int rowForNode(Node node) {
for (int i = 0; i < nodeRows.length; i++) {
if (node.equals(nodeRows[i])) {
return i;
}
}
return -1;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
private int rowForNode(Node node) {
for (int i = 0; i < nodeRows.length; i++) {
if (node.equals(nodeRows[i]))
return i;
}
return -1;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
private int rowForNode(Node node) {
for (int i = 0; i < nodeRows.length; i++) {
if (node.equals(nodeRows[i]))
return i;
}
return -1;
}
代码示例来源:origin: stackoverflow.com
@Override
public int compare(Node n1, Node n2) {
// TODO Auto-generated method stub
if(n1.cost > n2.cost) return 1;
else if(n1.cost < n2.cost) return -1;
else return ( n1.equals(n2)? 0 : 1);
}
代码示例来源:origin: stackoverflow.com
for(int i=0; i<rootChildren.length; i++){
Node rootChild = rootChildren[i];
//see if the addChar1 already exists in the tree
//if it doesn't
if(!rootChild.equals(addChar1)){
//add the addChar1 as a child of the root
root.addChild(addChar1);
}
else{
System.out.println(addChar1.getItem() + " Exists in the tree already");
}
代码示例来源:origin: stackoverflow.com
ArrayList<Node> tempList = new ArrayList<Node>();
Node head = nodesAttachedTo.get(0); //get the head of the list
tempList.add(head);
Node runner = head;
runner = runner.next;
while (!runner.equals(head)) {
tempList.add(runner);
runner = runner.next;
}
代码示例来源:origin: stackoverflow.com
private HashMap<Source, ArrayList<Node>> sourceMap = new HashMap<Source, ArrayList<Node>>();
private HashMap<Target, ArrayList<Node>> targetMap = new HashMap<Target, ArrayList<Node>>();
private HashMap<Cost, ArrayList<Node>> costMap = new HashMap<Cost, ArrayList<Node>>();
/** Look for a node with a given source */
for( Node node : sourceMap.get(keySource) )
{
/** Test the node for equality with a given node. Equals method below */
if(node.equals(nodeYouAreLookingFor) { return node; }
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
/** Checks whether given Node is a subnode of rootContext.
* @return true if specified Node is under current rootContext
*/
private boolean isUnderRoot(Node rootContext, Node node) {
while (node != null) {
if (node.equals(rootContext)) {
return true;
}
node = node.getParentNode();
}
return false;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
/** Checks whether given Node is a subnode of rootContext.
* @return true if specified Node is under current rootContext
*/
private boolean isUnderRoot(Node node) {
while (node != null) {
if (node.equals(rootContext)) return true;
node = node.getParentNode();
}
return false;
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
/** Checks whether given Node is a subnode of rootContext.
* @return true if specified Node is under current rootContext
*/
private boolean isUnderRoot(Node node) {
while (node != null) {
if (node.equals(rootContext)) {
return true;
}
node = node.getParentNode();
}
return false;
}
代码示例来源:origin: stackoverflow.com
private boolean treeCompare(Node firstNode, Node secondNode) {
if (firstNode == secondNode)
return true;
if (firstNode == null || !firstNode.equals(secondNode))
return false;
return treeCompare(firstNode.left, secondNode.left) && treeCompare(firstNode.right, secondNode.right);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui
private boolean isSelected(TestMethodNode testMethod, Node selected) {
if (testMethod.equals(selected)) {
return true;
}
for (Node node : testMethod.getChildren().getNodes()) {
if (node.equals(selected)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-templates
@Override
protected void filterChildrenAdded (NodeMemberEvent ev) {
super.filterChildrenAdded (ev);
if (getTemplateRootNode ().equals (this.getNode ())) {
sortNodes ();
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-templates
@Override
protected void addNotify () {
super.addNotify ();
if (getTemplateRootNode ().equals (this.getNode ())) {
sortNodes ();
}
}
代码示例来源:origin: stackoverflow.com
public int countPaths(Graph graph, Node u, Node v) {
nodes = graph.getNodes();
edges = new ArrayList<>(graph.getEdges());
if (u.equals(v)) return 1;
int count = 0;
List<Edge> neighbours = u.getNeighbouringEdges(edges);
for(Edge edge : neighbours){
w = edge.getTo();
count += countPaths(graph, w, v);
}
return count;
}
内容来源于网络,如有侵权,请联系作者删除!