mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 09:45:39 +02:00
Added isChildOf method.
This commit is contained in:
parent
8e3b8e26e4
commit
555148b018
1 changed files with 14 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue