类 Token

所有已实现的接口:
Op

@Immutable public final class Token extends Doc implements Op
A leaf Doc for a token.
  • 方法详细资料

    • getPlusIndentCommentsBefore

      public Indent getPlusIndentCommentsBefore()
      How much extra to indent comments before the Token.
      返回:
      the extra indent
    • breakAndIndentTrailingComment

      public Optional<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 a Token.
      参数:
      token - the Input.Token to wrap
      realOrImaginary - did this Input.Token appear in the input, or was it generated incorrectly?
      plusIndentCommentsBefore - extra plusIndent for comments just before this token
      返回:
      the new Token
    • getToken

      public Input.Token getToken()
      Return the wrapped Input.Token.
      返回:
      the Input.Token
    • realOrImaginary

      public Token.RealOrImaginary realOrImaginary()
      Is the token good? That is, does it match an Input.Token?
      返回:
      whether the @code Token} is good
    • add

      public void add(DocBuilder builder)
      从接口复制的说明: Op
      Add an Op to a DocBuilder.
      指定者:
      add 在接口中 Op
      参数:
      builder - the DocBuilder
    • computeWidth

      protected float computeWidth()
      从类复制的说明: Doc
      Compute the Doc's width.
      指定者:
      computeWidth 在类中 Doc
      返回:
      the width, or Float.POSITIVE_INFINITY if it must be broken
    • computeFlat

      protected String computeFlat()
      从类复制的说明: Doc
      Compute the Doc's flat value. Not defined (and never called) if contains forced breaks.
      指定者:
      computeFlat 在类中 Doc
      返回:
      the flat value
    • computeRange

      protected com.google.common.collect.Range<Integer> computeRange()
      从类复制的说明: Doc
      Compute the Doc's Range of Input.Tokens.
      指定者:
      computeRange 在类中 Doc
      返回:
      the Range
    • computeBreaks

      public State computeBreaks(CommentsHelper commentsHelper, int maxWidth, State state, Obs.ExplorationNode observationNode)
      从类复制的说明: Doc
      Make breaking decisions for a Doc.
      指定者:
      computeBreaks 在类中 Doc
      参数:
      maxWidth - the maximum line width
      state - the current output state
      返回:
      the new output state
    • write

      public void write(State state, Output output)
      从类复制的说明: Doc
      Write a Doc to an Output, after breaking decisions have been made.
      指定者:
      write 在类中 Doc
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object