Package com.google.googlejavaformat
Class Doc.Tok
- java.lang.Object
-
- com.google.googlejavaformat.Doc
-
- com.google.googlejavaformat.Doc.Tok
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Stringtextprivate Input.Toktok-
Fields inherited from class com.google.googlejavaformat.Doc
MAX_LINE_WIDTH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(DocBuilder builder)Add anOpto aDocBuilder.Doc.StatecomputeBreaks(CommentsHelper commentsHelper, int maxWidth, Doc.State state)Make breaking decisions for aDoc.(package private) java.lang.StringcomputeFlat()Compute theDoc's flat value.(package private) com.google.common.collect.Range<java.lang.Integer>computeRange()(package private) intcomputeWidth()Compute theDoc's width.(package private) static Doc.Tokmake(Input.Tok tok)Factory method for aTok.java.lang.StringtoString()voidwrite(Output output)Write aDocto anOutput, after breaking decisions have been made.
-
-
-
Field Detail
-
tok
private final Input.Tok tok
-
text
java.lang.String text
-
-
Constructor Detail
-
Tok
private Tok(Input.Tok tok)
-
-
Method Detail
-
make
static Doc.Tok make(Input.Tok tok)
Factory method for aTok.- Parameters:
tok- theInput.Tokto wrap- Returns:
- the new
Tok
-
add
public void add(DocBuilder builder)
Description copied from interface:OpAdd anOpto aDocBuilder.- Specified by:
addin interfaceOp- Parameters:
builder- theDocBuilder
-
computeWidth
int computeWidth()
Description copied from class:DocCompute theDoc's width.- Specified by:
computeWidthin classDoc- Returns:
- the width
-
computeFlat
java.lang.String computeFlat()
Description copied from class:DocCompute theDoc's flat value. Not defined (and never called) if contains forced breaks.- Specified by:
computeFlatin classDoc- Returns:
- the flat value
-
computeRange
com.google.common.collect.Range<java.lang.Integer> computeRange()
Description copied from class:Doc- Specified by:
computeRangein classDoc- Returns:
- the
Range
-
computeBreaks
public Doc.State computeBreaks(CommentsHelper commentsHelper, int maxWidth, Doc.State state)
Description copied from class:DocMake breaking decisions for aDoc.- Specified by:
computeBreaksin classDocmaxWidth- the maximum line widthstate- the current output state- Returns:
- the new output state
-
write
public void write(Output output)
Description copied from class:DocWrite aDocto anOutput, after breaking decisions have been made.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-