Class IndentationCalculator.EnforcingContext

  • Enclosing class:
    IndentationCalculator

    public static class IndentationCalculator.EnforcingContext
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      EnforcingContext​(int startIndex, int extraCharacters)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int getExtraCharacters()
      Returns the total number of extra whitespace characters found.
      int getStartIndex()
      Returns the starting index of the whitespace sequence to potentially remove.
      boolean hasExtraCharacters()
      Returns whether there are any extra characters to remove.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EnforcingContext

        public EnforcingContext​(int startIndex,
                                int extraCharacters)
    • Method Detail

      • 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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object