类 Token
java.lang.Object
com.palantir.javaformat.doc.HasUniqueId
com.palantir.javaformat.doc.Doc
com.palantir.javaformat.doc.Token
- 所有已实现的接口:
Op
A leaf
Doc for a token.-
嵌套类概要
嵌套类修饰符和类型类说明static enumIs a Token a real token, or imaginary (e.g., a token generated incorrectly, or an EOF)? -
方法概要
修饰符和类型方法说明voidadd(DocBuilder builder) Add anOpto aDocBuilder.Force a line break and indent trailing javadoc or block comments.computeBreaks(CommentsHelper commentsHelper, int maxWidth, State state, Obs.ExplorationNode observationNode) Make breaking decisions for aDoc.protected StringCompute theDoc's flat value.protected com.google.common.collect.Range<Integer> protected floatCompute theDoc's width.How much extra to indent comments before theToken.getToken()Return the wrappedInput.Token.static Opmake(Input.Token token, Token.RealOrImaginary realOrImaginary, Indent plusIndentCommentsBefore, Optional<Indent> breakAndIndentTrailingComment) Make aToken.Is the token good?toString()voidWrite aDocto anOutput, after breaking decisions have been made.从类继承的方法 com.palantir.javaformat.doc.HasUniqueId
id
-
方法详细资料
-
getPlusIndentCommentsBefore
How much extra to indent comments before theToken.- 返回:
- the extra indent
-
breakAndIndentTrailingComment
Force a line break and indent trailing javadoc or block comments. -
make
public static Op make(Input.Token token, Token.RealOrImaginary realOrImaginary, Indent plusIndentCommentsBefore, Optional<Indent> breakAndIndentTrailingComment) Make aToken.- 参数:
token- theInput.Tokento wraprealOrImaginary- did thisInput.Tokenappear in the input, or was it generated incorrectly?plusIndentCommentsBefore- extraplusIndentfor comments just before this token- 返回:
- the new
Token
-
getToken
Return the wrappedInput.Token.- 返回:
- the
Input.Token
-
realOrImaginary
Is the token good? That is, does it match anInput.Token?- 返回:
- whether the @code Token} is good
-
add
从接口复制的说明:OpAdd anOpto aDocBuilder.- 指定者:
add在接口中Op- 参数:
builder- theDocBuilder
-
computeWidth
protected float computeWidth()从类复制的说明:DocCompute theDoc's width.- 指定者:
computeWidth在类中Doc- 返回:
- the width, or
Float.POSITIVE_INFINITYif it must be broken
-
computeFlat
从类复制的说明:DocCompute theDoc's flat value. Not defined (and never called) if contains forced breaks.- 指定者:
computeFlat在类中Doc- 返回:
- the flat value
-
computeRange
从类复制的说明:Doc- 指定者:
computeRange在类中Doc- 返回:
- the
Range
-
computeBreaks
public State computeBreaks(CommentsHelper commentsHelper, int maxWidth, State state, Obs.ExplorationNode observationNode) 从类复制的说明:DocMake breaking decisions for aDoc.- 指定者:
computeBreaks在类中Doc- 参数:
maxWidth- the maximum line widthstate- the current output state- 返回:
- the new output state
-
write
从类复制的说明:DocWrite aDocto anOutput, after breaking decisions have been made. -
toString
-