Class IndentationConfiguration


  • public class IndentationConfiguration
    extends java.lang.Object
    Stores optional indentation configuration.
    Author:
    Holger Eichelberger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int additional  
      private int step  
      private int tabEmu  
    • Constructor Summary

      Constructors 
      Constructor Description
      IndentationConfiguration​(int step)
      Creates an indentation configuration object without tab emulation.
      IndentationConfiguration​(int step, int tabEmu)
      Creates an indentation configuration object.
      IndentationConfiguration​(int step, int tabEmu, int additional)
      Creates an indentation configuration object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAdditional()
      The number of additional whitespaces to be considered after indentation (extra indentation, language dependent).
      int getIndentationStep()
      Returns the number of whitespaces used for one indentation step.
      int getTabEmulation()
      Returns the number of whitespaces used to emulate a tabulator character.
      boolean isIndentationEnabled()
      Returns whether indentation is enabled.
      boolean isTabEmulationEnabled()
      Returns whether tab emulation is enabled.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • step

        private int step
      • tabEmu

        private int tabEmu
      • additional

        private int additional
    • Constructor Detail

      • IndentationConfiguration

        public IndentationConfiguration​(int step)
        Creates an indentation configuration object without tab emulation.
        Parameters:
        step - the number of whitespaces per indentation step (positive integer, 0 or negative if indentation shall be disabled)
      • IndentationConfiguration

        public IndentationConfiguration​(int step,
                                        int tabEmu)
        Creates an indentation configuration object.
        Parameters:
        step - the number of whitespaces per indentation step (positive integer, 0 or negative if indentation shall be disabled)
        tabEmu - the number of whitespaces per tab (0 or negative if disabled)
      • IndentationConfiguration

        public IndentationConfiguration​(int step,
                                        int tabEmu,
                                        int additional)
        Creates an indentation configuration object.
        Parameters:
        step - the number of whitespaces per indentation step (positive integer, 0 or negative if indentation shall be disabled)
        tabEmu - the number of whitespaces per tab (0 or negative if disabled)
        additional - additional whitespaces to be removed after indentation for extra formatting (language-dependent interpretation, non-negative integer)
    • Method Detail

      • getIndentationStep

        public int getIndentationStep()
        Returns the number of whitespaces used for one indentation step.
        Returns:
        the number of whitespaces (positive integer, 0 or negative if indentation shall be disabled)
      • isIndentationEnabled

        public boolean isIndentationEnabled()
        Returns whether indentation is enabled.
        Returns:
        true if indentation is enabled, false else
      • getTabEmulation

        public int getTabEmulation()
        Returns the number of whitespaces used to emulate a tabulator character.
        Returns:
        the number of whitespaces (0 or negative if disabled)
      • isTabEmulationEnabled

        public boolean isTabEmulationEnabled()
        Returns whether tab emulation is enabled.
        Returns:
        true if tab emulation is enabled, false else
      • getAdditional

        public int getAdditional()
        The number of additional whitespaces to be considered after indentation (extra indentation, language dependent).
        Returns:
        the number of additional whitespaces (non-negative integer)