Output.BreakTag
EMPTY_RANGE, range0s, range1s, ranges
Constructor and Description |
---|
JavaOutput(JavaInput javaInput,
CommentsHelper commentsHelper)
JavaOutput constructor. |
Modifier and Type | Method and Description |
---|---|
void |
append(String text,
Range<Integer> range)
Output a string.
|
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 . |
ImmutableList<Replacement> |
getFormatReplacements(RangeSet<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(int k)
Marks the boundary of 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.
|
String |
toString() |
void |
writeMerged(Appendable writer,
RangeSet<Integer> iRangeSet0)
Merge the (un-reformatted) input lines and the (reformatted) output lines.
|
computeRanges, getLine, getLineCount, getRange0s, getRange1s, getRanges, makeKToIJ, setLines
public JavaOutput(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(int k)
Output
markForPartialFormat
in class Output
k
- the token indexpublic void append(String text, Range<Integer> range)
Output
public void indent(int indent)
Output
indent
spaces.public CommentsHelper getCommentsHelper()
Output
CommentsHelper
.getCommentsHelper
in class Output
CommentsHelper
public ImmutableList<Replacement> getFormatReplacements(RangeSet<Integer> iRangeSet0)
Replacement
s to convert from input to output.Replacement
s, sorted by start index, without overlapspublic void writeMerged(Appendable writer, RangeSet<Integer> iRangeSet0) throws IOException
writer
- the destination Writer
iRangeSet0
- the canonical Range
of tokens to reformatIOException
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–2016 Google Inc.. All rights reserved.