Package com.palantir.javaformat.doc
Class State
java.lang.Object
com.palantir.javaformat.doc.State
State for writing.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intCounts how many times reached a branch, where multiple formattings would be considered.protected abstract fj.data.TreeMap<Break,com.palantir.javaformat.doc.State.BreakState> protected abstract fj.data.Set<BreakTag>static State.Builderbuilder()abstract intcolumn()com.palantir.javaformat.doc.State.BreakStategetBreakState(Break brk) abstract intindent()Next indent, if the level is about to be broken.abstract intLast indent that was actually taken.protected abstract fj.data.TreeMap<Level,com.palantir.javaformat.doc.State.LevelState> abstract booleanabstract intnumLines()Counts how many lines a particular formatting took.static Stateprotected abstract fj.data.TreeMap<Comment,com.palantir.javaformat.doc.State.TokState> Keep track of how eachCommentwas written (these are mostly comments), which can differ depending on the starting column and the maxLength.booleanwasBreakTaken(BreakTag breakTag)
-
Constructor Details
-
State
public State()
-
-
Method Details
-
lastIndent
public abstract int lastIndent()Last indent that was actually taken. -
indent
public abstract int indent()Next indent, if the level is about to be broken. -
column
public abstract int column() -
mustBreak
public abstract boolean mustBreak() -
numLines
public abstract int numLines()Counts how many lines a particular formatting took. -
branchingCoefficient
public abstract int branchingCoefficient()Counts how many times reached a branch, where multiple formattings would be considered. Expected runtime is exponential in this number.- See Also:
-
withNewBranch()
-
breakTagsTaken
-
breakStates
@Auxiliary protected abstract fj.data.TreeMap<Break,com.palantir.javaformat.doc.State.BreakState> breakStates() -
levelStates
@Auxiliary protected abstract fj.data.TreeMap<Level,com.palantir.javaformat.doc.State.LevelState> levelStates() -
tokStates
@Auxiliary protected abstract fj.data.TreeMap<Comment,com.palantir.javaformat.doc.State.TokState> tokStates()Keep track of how eachCommentwas written (these are mostly comments), which can differ depending on the starting column and the maxLength. -
startingState
-
getBreakState
-
wasBreakTaken
-
builder
-