Class IndentationCalculator.EnforcingContext

java.lang.Object
com.github.javaparser.printer.lexicalpreservation.IndentationCalculator.EnforcingContext
Enclosing class:
IndentationCalculator

public static class IndentationCalculator.EnforcingContext extends Object
Context information for enforcing indentation. Contains the starting position and the number of extra characters to remove. This is an immutable value object returned by analyzeEnforcingContext.
  • Constructor Details

    • EnforcingContext

      public EnforcingContext(int startIndex, int extraCharacters)
  • Method Details

    • getStartIndex

      public int getStartIndex()
      Returns the starting index of the whitespace sequence to potentially remove.
      Returns:
      the start index
    • getExtraCharacters

      public int getExtraCharacters()
      Returns the total number of extra whitespace characters found.
      Returns:
      count of extra characters
    • hasExtraCharacters

      public boolean hasExtraCharacters()
      Returns whether there are any extra characters to remove.
      Returns:
      true if extraCharacters > 0
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object