| Modifier and Type | Class and Description |
|---|---|
static class |
Token.RealOrImaginary
Is a Token a real token, or imaginary (e.g., a token generated incorrectly, or an EOF)?
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(DocBuilder builder)
Add an
Op to a DocBuilder. |
java.util.Optional<Indent> |
breakAndIndentTrailingComment()
Force a line break and indent trailing javadoc or block comments.
|
State |
computeBreaks(CommentsHelper commentsHelper,
int maxWidth,
State state,
Obs.ExplorationNode observationNode)
Make breaking decisions for a
Doc. |
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. |
Indent |
getPlusIndentCommentsBefore()
How much extra to indent comments before the
Token. |
Input.Token |
getToken()
Return the wrapped
Input.Token. |
static Op |
make(Input.Token token,
Token.RealOrImaginary realOrImaginary,
Indent plusIndentCommentsBefore,
java.util.Optional<Indent> breakAndIndentTrailingComment)
Make a
Token. |
Token.RealOrImaginary |
realOrImaginary()
Is the token good? That is, does it match an
Input.Token? |
java.lang.String |
toString() |
void |
write(State state,
Output output)
Write a
Doc to an Output, after breaking decisions have been made. |
idpublic Indent getPlusIndentCommentsBefore()
Token.public java.util.Optional<Indent> breakAndIndentTrailingComment()
public static Op make(Input.Token token, Token.RealOrImaginary realOrImaginary, Indent plusIndentCommentsBefore, java.util.Optional<Indent> breakAndIndentTrailingComment)
Token.token - the Input.Token to wraprealOrImaginary - did this Input.Token appear in the input, or was it generated incorrectly?plusIndentCommentsBefore - extra plusIndent for comments just before this tokenTokenpublic Input.Token getToken()
Input.Token.Input.Tokenpublic Token.RealOrImaginary realOrImaginary()
Input.Token?public 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 java.lang.String toString()
toString in class java.lang.Object