Package com.google.googlejavaformat
Interface Input.Tok
-
- All Known Implementing Classes:
JavaInput.Tok
- Enclosing class:
- Input
public static interface Input.TokATok("tock") is a token, or a comment, or a newline, or a maximal string of blanks. A tokenTokunderlies aInput.Token, and each otherTokis attached to a singleToken. Tokens and comments have indices; white spaceToks do not.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetColumn()Return theTok's0-based column number.intgetIndex()Return theTok's index.java.lang.StringgetOriginalText()TheTok's original text (before processing escapes).intgetPosition()Return theTok's0-based position.java.lang.StringgetText()TheTok's text.booleanisComment()Is theToka comment?booleanisJavadocComment()Is theToka javadoc comment?booleanisNewline()Is theToka newline?booleanisSlashSlashComment()Is theToka "//" comment?booleanisSlashStarComment()Is theToka "/*" comment?intlength()The length of theTok's original text.
-
-
-
Method Detail
-
getIndex
int getIndex()
Return theTok's index.- Returns:
- its index
-
getPosition
int getPosition()
Return theTok's0-based position.- Returns:
- its position
-
getColumn
int getColumn()
Return theTok's0-based column number.- Returns:
- its column number
-
getText
java.lang.String getText()
TheTok's text.
-
getOriginalText
java.lang.String getOriginalText()
TheTok's original text (before processing escapes).
-
length
int length()
The length of theTok's original text.
-
isNewline
boolean isNewline()
Is theToka newline?
-
isSlashSlashComment
boolean isSlashSlashComment()
Is theToka "//" comment?
-
isSlashStarComment
boolean isSlashStarComment()
Is theToka "/*" comment?
-
isJavadocComment
boolean isJavadocComment()
Is theToka javadoc comment?
-
isComment
boolean isComment()
Is theToka comment?
-
-