Class StringReplacer.Positions

  • Enclosing class:
    StringReplacer<I extends VariableDeclaration,​R extends Resolver<I>>

    private static class StringReplacer.Positions
    extends java.lang.Object
    Stores in-place command positions for replacing. Consists of the open-position (parsing positions where the in-place command started) and the optional latest mid-position (parsing positions if the in-place command consists of multiple mid parts, e.g., if-else).
    Author:
    Holger Eichelberger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int midPos  
      private int openCurPos  
      private int openPos  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Positions​(int curPos, int pos)
      Creates a position object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private int getLatestPos()
      The latest available start parsing position.
      private void setLatestPos​(int pos)
      Changes the latest available start parsing position to avoid double creation of expressions.
      • Methods inherited from class java.lang.Object

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

      • openCurPos

        private int openCurPos
      • openPos

        private int openPos
      • midPos

        private int midPos
    • Constructor Detail

      • Positions

        private Positions​(int curPos,
                          int pos)
        Creates a position object.
        Parameters:
        curPos - the concept start position
        pos - the parsing position
    • Method Detail

      • getLatestPos

        private int getLatestPos()
        The latest available start parsing position.
        Returns:
        the position
      • setLatestPos

        private void setLatestPos​(int pos)
        Changes the latest available start parsing position to avoid double creation of expressions.
        Parameters:
        pos - the new position