mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
Added isChildOf method.
This commit is contained in:
parent
8e3b8e26e4
commit
555148b018
1 changed files with 14 additions and 1 deletions
|
@ -67,6 +67,19 @@ public abstract class PDOMNode implements IPDOMNode {
|
||||||
return record;
|
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
|
@Override
|
||||||
public final boolean equals(Object obj) {
|
public final boolean equals(Object obj) {
|
||||||
if (obj == this)
|
if (obj == this)
|
||||||
|
|
Loading…
Add table
Reference in a new issue