java.lang.Object
com.google.googlejavaformat.Doc
com.google.googlejavaformat.Doc.Token
- All Implemented Interfaces:
Op
- Enclosing class:
- Doc
public static final class Doc.Token extends Doc implements Op
A leaf
Doc
for a token.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Doc.Token.RealOrImaginary
Is a Token a real token, or imaginary (e.g., a token generated incorrectly, or an EOF)?Nested classes/interfaces inherited from class com.google.googlejavaformat.Doc
Doc.Break, Doc.FillMode, Doc.State, Doc.Token
-
Method Summary
Modifier and Type Method Description void
add(DocBuilder builder)
Add anOp
to aDocBuilder
.Doc.State
computeBreaks(CommentsHelper commentsHelper, int maxWidth, Doc.State state)
Make breaking decisions for aDoc
.String
toString()
void
write(Output output)
Write aDoc
to anOutput
, after breaking decisions have been made.
-
Method Details
-
add
Description copied from interface:Op
Add anOp
to aDocBuilder
.- Specified by:
add
in interfaceOp
- Parameters:
builder
- theDocBuilder
-
computeBreaks
Description copied from class:Doc
Make breaking decisions for aDoc
.- Specified by:
computeBreaks
in classDoc
maxWidth
- the maximum line widthstate
- the current output state- Returns:
- the new output state
-
write
Description copied from class:Doc
Write aDoc
to anOutput
, after breaking decisions have been made. -
toString
-