Output.BreakTag
EMPTY_RANGE, ranges
Constructor and Description |
---|
JavaOutput(java.lang.String lineSeparator,
JavaInput javaInput,
CommentsHelper commentsHelper)
JavaOutput constructor. |
Modifier and Type | Method and Description |
---|---|
void |
append(java.lang.String text,
com.google.common.collect.Range<java.lang.Integer> range)
Output a string.
|
static java.lang.String |
applyReplacements(java.lang.String input,
java.util.List<Replacement> replacements) |
void |
blankLine(int k,
OpsBuilder.BlankLineWanted wanted)
A blank line is or is not wanted here.
|
static Input.Tok |
endTok(Input.Token token)
The last non-whitespace Tok in the Token.
|
CommentsHelper |
getCommentsHelper()
Get the
CommentsHelper . |
com.google.common.collect.ImmutableList<Replacement> |
getFormatReplacements(com.google.common.collect.RangeSet<java.lang.Integer> iRangeSet0)
Emit a list of
Replacement s to convert from input to output. |
void |
indent(int indent)
Indent by outputting
indent spaces. |
void |
markForPartialFormat(Input.Token start,
Input.Token end)
Marks a region that can be partially formatted.
|
static int |
startPosition(Input.Token token)
The earliest position of any Tok in the Token, including leading whitespace.
|
static Input.Tok |
startTok(Input.Token token)
The earliest non-whitespace Tok in the Token.
|
java.lang.String |
toString() |
computeRanges, getLine, getLineCount, getRanges, makeKToIJ, setLines
public JavaOutput(java.lang.String lineSeparator, JavaInput javaInput, CommentsHelper commentsHelper)
JavaOutput
constructor.javaInput
- the JavaInput
, used to match up blank lines in the outputcommentsHelper
- the CommentsHelper
, used to rewrite commentspublic void blankLine(int k, OpsBuilder.BlankLineWanted wanted)
Output
public void markForPartialFormat(Input.Token start, Input.Token end)
Output
markForPartialFormat
in class Output
public void append(java.lang.String text, com.google.common.collect.Range<java.lang.Integer> range)
Output
public void indent(int indent)
Output
indent
spaces.public CommentsHelper getCommentsHelper()
Output
CommentsHelper
.getCommentsHelper
in class Output
CommentsHelper
public com.google.common.collect.ImmutableList<Replacement> getFormatReplacements(com.google.common.collect.RangeSet<java.lang.Integer> iRangeSet0)
Replacement
s to convert from input to output.Replacement
s, sorted by start index, without overlapspublic static java.lang.String applyReplacements(java.lang.String input, java.util.List<Replacement> replacements)
public static int startPosition(Input.Token token)
public static Input.Tok startTok(Input.Token token)
public static Input.Tok endTok(Input.Token token)
Copyright © 2015-2018 Google Inc.. All Rights Reserved.