Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSergey Prigogin2008-04-13 22:01:21 -0400
committerSergey Prigogin2008-04-13 22:01:21 -0400
commit555148b01800289a0b6dbb26ab78ebc2e19882d3 (patch)
tree1f092eb685bf6a5a60558adec215823f7f26fc45 /core
parent8e3b8e26e4dc304bd80c30652518c4b25dc3653a (diff)
downloadorg.eclipse.cdt-555148b01800289a0b6dbb26ab78ebc2e19882d3.tar.gz
org.eclipse.cdt-555148b01800289a0b6dbb26ab78ebc2e19882d3.tar.xz
org.eclipse.cdt-555148b01800289a0b6dbb26ab78ebc2e19882d3.zip
Added isChildOf method.
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java
index 18ea620d692..fe2836be9d6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java
@@ -66,7 +66,20 @@ public abstract class PDOMNode implements IPDOMNode {
public int getRecord() {
return record;
}
-
+
+ /**
+ * Checks if <code>other</code> node is the immediate parent of this one.
+ * @param other paternity test subject.
+ * @return <code>true</code> if <code>other</code> node in the parent of this one.
+ */
+ public boolean isChildOf(PDOMNode other) {
+ try {
+ return other.pdom == pdom && other.record == getParentNodeRec();
+ } catch (CoreException e) {
+ return false;
+ }
+ }
+
@Override
public final boolean equals(Object obj) {
if (obj == this)

Back to the top