Package com.palantir.javaformat.doc
Class Level
java.lang.Object
com.palantir.javaformat.doc.HasUniqueId
com.palantir.javaformat.doc.Doc
com.palantir.javaformat.doc.Level
A
Level inside a Doc.-
Method Summary
Modifier and TypeMethodDescriptioncomputeBreaks(CommentsHelper commentsHelper, int maxWidth, State state, Obs.ExplorationNode observer) Make breaking decisions for aDoc.protected StringCompute theDoc's flat value.protected com.google.common.collect.Range<Integer>protected floatCompute theDoc's width.An optional, more restrictive column limit for inner breaks that are marked asBreak.hasColumnLimit().representation(State state) An indented representation of this level and all nested levels inside it.toString()voidWrite aDocto anOutput, after breaking decisions have been made.Methods inherited from class com.palantir.javaformat.doc.HasUniqueId
id
-
Method Details
-
computeWidth
protected float computeWidth()Description copied from class:DocCompute theDoc's width.- Specified by:
computeWidthin classDoc- Returns:
- the width, or
Float.POSITIVE_INFINITYif it must be broken
-
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
Description copied from class:Doc- Specified by:
computeRangein classDoc- Returns:
- the
Range
-
computeBreaks
public State computeBreaks(CommentsHelper commentsHelper, int maxWidth, State state, Obs.ExplorationNode observer) 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
Description copied from class:DocWrite aDocto anOutput, after breaking decisions have been made. -
getPlusIndent
-
partialInlineability
-
getDebugName
-
getOpenOp
-
getColumnLimitBeforeLastBreak
An optional, more restrictive column limit for inner breaks that are marked asBreak.hasColumnLimit(). If the level is to be considered one-lineable, the last such break must not start at a column higher than this. -
representation
An indented representation of this level and all nested levels inside it. -
toString
-