Package com.google.googlejavaformat
Interface Input.Tok
- Enclosing class:
- Input
public static interface Input.Tok
A
Tok ("tock") is a token, or a comment, or a newline, or a maximal string of blanks. A
token Tok underlies a Input.Token, and each other Tok is attached to a single
Token. Tokens and comments have indices; white space Toks do not.-
Method Summary
Modifier and TypeMethodDescriptionintReturn theTok's0-based column number.intgetIndex()Return theTok's index.TheTok's original text (before processing escapes).intReturn theTok's0-based position.getText()TheTok's text.booleanIs theToka comment?booleanIs theToka javadoc comment?booleanIs theToka newline?booleanIs theToka "//" comment?booleanIs theToka "/*" comment?intlength()The length of theTok's original text.
-
Method Details
-
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
String getText()TheTok's text. -
getOriginalText
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?
-