Class DetailAstSet
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.indentation.DetailAstSet
-
public class DetailAstSet extends java.lang.Object
Represents a set of abstract syntax tree.
-
-
Constructor Summary
Constructors Constructor Description DetailAstSet(IndentationCheck indentCheck)
Construct an instance of this class withIndentationCheck
parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAst(DetailAST ast)
Add ast to the set of ast.protected int
expandedTabsColumnNo(DetailAST ast)
Get the column number for the start of a given expression, expanding tabs out into spaces in the process.DetailAST
firstLine()
The first line in set of ast.DetailAST
getAst(int lineNum)
Get the ast corresponding to line number.java.lang.Integer
getStartColumn(int lineNum)
Get starting column number for the ast.boolean
isEmpty()
Check if the this set of ast is empty.java.lang.Integer
lastLine()
Get the line number of the last line.
-
-
-
Constructor Detail
-
DetailAstSet
public DetailAstSet(IndentationCheck indentCheck)
Construct an instance of this class withIndentationCheck
parameters.- Parameters:
indentCheck
- IndentationCheck parameters
-
-
Method Detail
-
addAst
public void addAst(DetailAST ast)
Add ast to the set of ast.- Parameters:
ast
- the ast to add
-
getStartColumn
public java.lang.Integer getStartColumn(int lineNum)
Get starting column number for the ast.- Parameters:
lineNum
- the line number as key- Returns:
- start column for ast
-
isEmpty
public boolean isEmpty()
Check if the this set of ast is empty.- Returns:
- true if empty, false otherwise
-
firstLine
public DetailAST firstLine()
The first line in set of ast.- Returns:
- first line in set of ast.
-
getAst
public DetailAST getAst(int lineNum)
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
public java.lang.Integer lastLine()
Get the line number of the last line.- Returns:
- the line number of the last line
-
expandedTabsColumnNo
protected final int expandedTabsColumnNo(DetailAST ast)
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
-
-