Class IndentationCalculator.EnforcingContext
- java.lang.Object
-
- com.github.javaparser.printer.lexicalpreservation.IndentationCalculator.EnforcingContext
-
- Enclosing class:
- IndentationCalculator
public static class IndentationCalculator.EnforcingContext extends java.lang.ObjectContext 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 booleanequals(java.lang.Object o)intgetExtraCharacters()Returns the total number of extra whitespace characters found.intgetStartIndex()Returns the starting index of the whitespace sequence to potentially remove.booleanhasExtraCharacters()Returns whether there are any extra characters to remove.inthashCode()java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-