Package com.google.googlejavaformat.java
Class JavaInput.Token
- java.lang.Object
-
- com.google.googlejavaformat.java.JavaInput.Token
-
- All Implemented Interfaces:
Input.Token
- Enclosing class:
- JavaInput
static final class JavaInput.Token extends java.lang.Object implements Input.Token
AJavaInput.Tokencontains a tokenJavaInput.Tokand its associated non-tokens; each non-tokenJavaInput.Tokbelongs to oneJavaInput.Token. EachJavaInput.Tokenhas an immutable list of its non-tokens that appear before it, and another list of its non-tokens that appear after it. The concatenation of the texts of all theJavaInput.Tokens'JavaInput.Toks, each preceded by the texts of itstoksBeforeand followed by the texts of itstoksAfter, equals the input.
-
-
Field Summary
Fields Modifier and Type Field Description private JavaInput.Toktokprivate com.google.common.collect.ImmutableList<JavaInput.Tok>toksAfterprivate com.google.common.collect.ImmutableList<JavaInput.Tok>toksBefore
-
Constructor Summary
Constructors Constructor Description Token(java.util.List<JavaInput.Tok> toksBefore, JavaInput.Tok tok, java.util.List<JavaInput.Tok> toksAfter)Token constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaInput.TokgetTok()Get the token'sJavaInput.Tok.com.google.common.collect.ImmutableList<? extends Input.Tok>getToksAfter()Get the laterJavaInput.Toks assigned to thisToken.com.google.common.collect.ImmutableList<? extends Input.Tok>getToksBefore()Get the earlierJavaInput.Toks assigned to thisToken.java.lang.StringtoString()
-
-
-
Field Detail
-
tok
private final JavaInput.Tok tok
-
toksBefore
private final com.google.common.collect.ImmutableList<JavaInput.Tok> toksBefore
-
toksAfter
private final com.google.common.collect.ImmutableList<JavaInput.Tok> toksAfter
-
-
Constructor Detail
-
Token
Token(java.util.List<JavaInput.Tok> toksBefore, JavaInput.Tok tok, java.util.List<JavaInput.Tok> toksAfter)
Token constructor.- Parameters:
toksBefore- the earlier non-token {link Tok}s assigned to thisTokentok- this tokenJavaInput.ToktoksAfter- the later non-token {link Tok}s assigned to thisToken
-
-
Method Detail
-
getTok
public JavaInput.Tok getTok()
Get the token'sJavaInput.Tok.- Specified by:
getTokin interfaceInput.Token- Returns:
- the token's
JavaInput.Tok
-
getToksBefore
public com.google.common.collect.ImmutableList<? extends Input.Tok> getToksBefore()
Get the earlierJavaInput.Toks assigned to thisToken.- Specified by:
getToksBeforein interfaceInput.Token- Returns:
- the earlier
JavaInput.Toks assigned to thisToken
-
getToksAfter
public com.google.common.collect.ImmutableList<? extends Input.Tok> getToksAfter()
Get the laterJavaInput.Toks assigned to thisToken.- Specified by:
getToksAfterin interfaceInput.Token- Returns:
- the later
JavaInput.Toks assigned to thisToken
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-