| Modifier and Type | Class and Description |
|---|---|
static class |
Break.Builder |
| Constructor and Description |
|---|
Break() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(DocBuilder builder)
Add an
Op to a DocBuilder. |
static Break.Builder |
builder() |
State |
computeBreaks(CommentsHelper commentsHelper,
int maxWidth,
State state,
Obs.ExplorationNode observationNode)
Make breaking decisions for a
Doc. |
State |
computeBreaks(State stateIn,
boolean broken) |
protected java.lang.String |
computeFlat()
Compute the
Doc's flat value. |
protected com.google.common.collect.Range<java.lang.Integer> |
computeRange()
Compute the
Doc's Range of Input.Tokens. |
protected float |
computeWidth()
Compute the
Doc's width. |
int |
evalPlusIndent(State state)
Return the
Break's extra indent. |
abstract FillMode |
fillMode() |
abstract java.lang.String |
flat() |
abstract boolean |
hasColumnLimit()
If this break is restricted by its parent
Level's Level.getColumnLimitBeforeLastBreak(). |
boolean |
isForced()
Is the
Break forced? |
static Break |
make(FillMode fillMode,
java.lang.String flat,
Indent plusIndent)
Make a
Break. |
static Break |
make(FillMode fillMode,
java.lang.String flat,
Indent plusIndent,
java.util.Optional<BreakTag> optTag)
Make a
Break. |
static Break |
makeForced()
Make a forced
Break. |
abstract java.util.Optional<BreakTag> |
optTag() |
abstract Indent |
plusIndent() |
void |
write(State state,
Output output)
Write a
Doc to an Output, after breaking decisions have been made. |
idpublic abstract FillMode fillMode()
public abstract java.lang.String flat()
public abstract Indent plusIndent()
public abstract java.util.Optional<BreakTag> optTag()
public abstract boolean hasColumnLimit()
Level's Level.getColumnLimitBeforeLastBreak().public static Break make(FillMode fillMode, java.lang.String flat, Indent plusIndent)
Break.fillMode - the FillModeflat - the text when not brokenplusIndent - extra indent if takenBreakpublic static Break make(FillMode fillMode, java.lang.String flat, Indent plusIndent, java.util.Optional<BreakTag> optTag)
Break.fillMode - the FillModeflat - the text when not brokenplusIndent - extra indent if takenoptTag - an optional tag for remembering whether the break was takenBreakpublic static Break makeForced()
Break.Breakpublic int evalPlusIndent(State state)
Break's extra indent.public boolean isForced()
Break forced?Break is forcedpublic void add(DocBuilder builder)
OpOp to a DocBuilder.add in interface Opbuilder - the DocBuilderprotected float computeWidth()
DocDoc's width.computeWidth in class DocFloat.POSITIVE_INFINITY if it must be brokenprotected java.lang.String computeFlat()
DocDoc's flat value. Not defined (and never called) if contains forced breaks.computeFlat in class Docprotected com.google.common.collect.Range<java.lang.Integer> computeRange()
DocDoc's Range of Input.Tokens.computeRange in class DocRangepublic State computeBreaks(CommentsHelper commentsHelper, int maxWidth, State state, Obs.ExplorationNode observationNode)
DocDoc.computeBreaks in class DocmaxWidth - the maximum line widthstate - the current output statepublic void write(State state, Output output)
DocDoc to an Output, after breaking decisions have been made.public static Break.Builder builder()