Package com.google.googlejavaformat
Class Doc.Tok
java.lang.Object
com.google.googlejavaformat.Doc
com.google.googlejavaformat.Doc.Tok
- All Implemented Interfaces:
Op
- Enclosing class:
Doc
A leaf node in a
Doc for a non-token.-
Nested Class Summary
-
Field Summary
FieldsFields inherited from class com.google.googlejavaformat.Doc
MAX_LINE_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(DocBuilder builder) Add anOpto aDocBuilder.computeBreaks(CommentsHelper commentsHelper, int maxWidth, Doc.State state) Make breaking decisions for aDoc.(package private) StringCompute theDoc's flat value.(package private) com.google.common.collect.Range<Integer> (package private) intCompute theDoc's width.(package private) static Doc.TokFactory method for aTok.toString()voidWrite aDocto anOutput, after breaking decisions have been made.
-
Field Details
-
tok
-
text
String text
-
-
Constructor Details
-
Tok
-
-
Method Details
-
make
Factory method for aTok.- Parameters:
tok- theInput.Tokto wrap- Returns:
- the new
Tok
-
add
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
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<Integer> computeRange()Description copied from class:Doc- Specified by:
computeRangein classDoc- Returns:
- the
Range
-
computeBreaks
Description copied from class:DocMake breaking decisions for aDoc.- Specified by:
computeBreaksin classDoc- Parameters:
maxWidth- the maximum line widthstate- the current output state- Returns:
- the new output state
-
write
Description copied from class:DocWrite aDocto anOutput, after breaking decisions have been made. -
toString
-