/** * Checks if the specified position intersects with a single line comment. * @param startLineNo the starting line number * @param startColNo the starting column number * @param endLineNo the ending line number * @param endColNo the ending column number * @return true if the positions intersects with a single line comment. */ private boolean hasIntersectionWithSingleLineComment(int startLineNo, int startColNo, int endLineNo, int endColNo) { boolean hasIntersection = false; // Check CPP comments (line searching is possible) for (int lineNumber = startLineNo; lineNumber <= endLineNo; lineNumber++) { final TextBlock comment = cppComments.get(lineNumber); if (comment != null && comment.intersects(startLineNo, startColNo, endLineNo, endColNo)) { hasIntersection = true; break; } } return hasIntersection; }
/** * Checks if the specified position intersects with a block comment. * @param startLineNo the starting line number * @param startColNo the starting column number * @param endLineNo the ending line number * @param endColNo the ending column number * @return true if the positions intersects with a block comment. */ private boolean hasIntersectionWithBlockComment(int startLineNo, int startColNo, int endLineNo, int endColNo) { boolean hasIntersection = false; // Check C comments (all comments should be checked) final Collection<List<TextBlock>> values = clangComments.values(); for (final List<TextBlock> row : values) { for (final TextBlock comment : row) { if (comment.intersects(startLineNo, startColNo, endLineNo, endColNo)) { hasIntersection = true; break; } } if (hasIntersection) { break; } } return hasIntersection; }
/** * Checks if the specified position intersects with a single line comment. * @param startLineNo the starting line number * @param startColNo the starting column number * @param endLineNo the ending line number * @param endColNo the ending column number * @return true if the positions intersects with a single line comment. */ private boolean hasIntersectionWithSingleLineComment(int startLineNo, int startColNo, int endLineNo, int endColNo) { boolean hasIntersection = false; // Check CPP comments (line searching is possible) for (int lineNumber = startLineNo; lineNumber <= endLineNo; lineNumber++) { final TextBlock comment = cppComments.get(lineNumber); if (comment != null && comment.intersects(startLineNo, startColNo, endLineNo, endColNo)) { hasIntersection = true; break; } } return hasIntersection; }
/** * Checks if the specified position intersects with a block comment. * @param startLineNo the starting line number * @param startColNo the starting column number * @param endLineNo the ending line number * @param endColNo the ending column number * @return true if the positions intersects with a block comment. */ private boolean hasIntersectionWithBlockComment(int startLineNo, int startColNo, int endLineNo, int endColNo) { boolean hasIntersection = false; // Check C comments (all comments should be checked) final Collection<List<TextBlock>> values = clangComments.values(); for (final List<TextBlock> row : values) { for (final TextBlock comment : row) { if (comment.intersects(startLineNo, startColNo, endLineNo, endColNo)) { hasIntersection = true; break; } } if (hasIntersection) { break; } } return hasIntersection; }