java.lang.Object
com.google.googlejavaformat.Doc
public abstract class Doc extends Object
JavaInputAstVisitor outputs a
sequence of Ops using OpsBuilder. This linear sequence is then transformed by
DocBuilder into a tree-structured Doc. The top-level Doc is a Doc.Level, which contains a sequence of Docs, including other Doc.Levels. Leaf
Docs are Doc.Tokens, representing language-level tokens; Doc.Toks, which may also
represent non-token Input.Toks, including comments and other white-space; Doc.Spaces,
representing single spaces; and Doc.Breaks, which represent optional line-breaks.-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description Doc() -
Method Summary
Modifier and Type Method Description abstract Doc.StatecomputeBreaks(CommentsHelper commentsHelper, int maxWidth, Doc.State state)Make breaking decisions for aDoc.abstract voidwrite(Output output)Write aDocto anOutput, after breaking decisions have been made.
-
Constructor Details
-
Doc
public Doc()
-
-
Method Details
-
computeBreaks
public abstract Doc.State computeBreaks(CommentsHelper commentsHelper, int maxWidth, Doc.State state)Make breaking decisions for aDoc.- Parameters:
maxWidth- the maximum line widthstate- the current output state- Returns:
- the new output state
-
write
Write aDocto anOutput, after breaking decisions have been made.
-