Class State

java.lang.Object
com.palantir.javaformat.doc.State

@Immutable @Immutable public abstract class State extends Object
State for writing.
  • 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

      @Auxiliary protected abstract fj.data.Set<BreakTag> 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 each Comment was written (these are mostly comments), which can differ depending on the starting column and the maxLength.
    • startingState

      public static State startingState()
    • getBreakState

      public com.palantir.javaformat.doc.State.BreakState getBreakState(Break brk)
    • wasBreakTaken

      public boolean wasBreakTaken(BreakTag breakTag)
    • builder

      public static State.Builder builder()