/* * (non-Javadoc) * * @see org.xmind.core.ITopicRange#encloses(org.xmind.core.ITopic) */ public boolean encloses(ITopic subtopic) { if (subtopic == null) return false; ITopic parent = subtopic.getParent(); if (parent == null || !parent.equals(getParent())) return false; int startIndex = getStartIndex(); int endIndex = getEndIndex(); int subIndex = subtopic.getIndex(); return subIndex >= startIndex && subIndex <= endIndex; }