/** * This is the list of Comment which are contained in the Node either because * they are properly associated to one of its children or because they are floating * around inside the Node. * @return */ public List<Comment> getAllContainedComments(){ List<Comment> comments = new LinkedList<Comment>(); comments.addAll(getOrphanComments()); for (Node child : getChildrenNodes()){ if (child.getComment()!=null){ comments.add(child.getComment()); } comments.addAll(child.getAllContainedComments()); } return comments; }