Class DetailAstSet
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.indentation.DetailAstSet
Represents a set of abstract syntax tree.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMaps line numbers to their ast.private final IndentationCheckThe instance ofIndentationCheckused by this class. -
Constructor Summary
ConstructorsConstructorDescriptionDetailAstSet(IndentationCheck indentCheck) Construct an instance of this class withIndentationCheckparameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd ast to the set of ast.private voidaddLineWithAst(int lineNo, DetailAST ast) Map ast with their line number.protected final intGet the column number for the start of a given expression, expanding tabs out into spaces in the process.The first line in set of ast.getAst(int lineNum) Get the ast corresponding to line number.getStartColumn(int lineNum) Get starting column number for the ast.booleanisEmpty()Check if this set of ast is empty.lastLine()Get the line number of the last line.
-
Field Details
-
indentCheck
The instance ofIndentationCheckused by this class. -
astLines
Maps line numbers to their ast.
-
-
Constructor Details
-
DetailAstSet
Construct an instance of this class withIndentationCheckparameters.- Parameters:
indentCheck- IndentationCheck parameters
-
-
Method Details
-
addAst
Add ast to the set of ast.- Parameters:
ast- the ast to add
-
addLineWithAst
Map ast with their line number.- Parameters:
lineNo- line number of ast to addast- ast to add
-
getStartColumn
Get starting column number for the ast.- Parameters:
lineNum- the line number as key- Returns:
- start column for ast
-
isEmpty
Check if this set of ast is empty.- Returns:
- true if empty, false otherwise
-
firstLine
The first line in set of ast.- Returns:
- first line in set of ast.
-
getAst
Get the ast corresponding to line number.- Parameters:
lineNum- line number of ast.- Returns:
- ast with their corresponding line number or null if no mapping is present
-
lastLine
Get the line number of the last line.- Returns:
- the line number of the last line
-
expandedTabsColumnNo
Get the column number for the start of a given expression, expanding tabs out into spaces in the process.- Parameters:
ast- the expression to find the start of- Returns:
- the column number for the start of the expression
-