List of usage examples for org.eclipse.jdt.core.dom Comment setAlternateRoot
public final void setAlternateRoot(ASTNode root)
null if none (or not recorded). From source file:org.eclipse.jdt.core.dom.ASTConverter.java
License:Open Source License
/** * @param compilationUnit/*from w w w .jav a2 s .c om*/ * @param comments */ void buildCommentsTable(CompilationUnit compilationUnit, int[][] comments) { // Build comment table this.commentsTable = new Comment[comments.length]; int nbr = 0; for (int i = 0; i < comments.length; i++) { Comment comment = createComment(comments[i]); if (comment != null) { comment.setAlternateRoot(compilationUnit); this.commentsTable[nbr++] = comment; } } // Resize table if necessary if (nbr < comments.length) { Comment[] newCommentsTable = new Comment[nbr]; System.arraycopy(this.commentsTable, 0, newCommentsTable, 0, nbr); this.commentsTable = newCommentsTable; } compilationUnit.setCommentTable(this.commentsTable); }