Class BaseCharFilter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int[] diffs  
      private int[] offsets  
      private int size  
      • Fields inherited from class java.io.Reader

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseCharFilter​(java.io.Reader in)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addOffCorrectMap​(int off, int cumulativeDiff)
      Adds an offset correction mapping at the given output stream offset.
      protected int correct​(int currentOff)
      Retrieve the corrected offset.
      protected int getLastCumulativeDiff()  
      • Methods inherited from class java.io.Reader

        mark, markSupported, nullReader, read, read, read, read, ready, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • offsets

        private int[] offsets
      • diffs

        private int[] diffs
      • size

        private int size
    • Constructor Detail

      • BaseCharFilter

        public BaseCharFilter​(java.io.Reader in)
    • Method Detail

      • correct

        protected int correct​(int currentOff)
        Retrieve the corrected offset.
        Specified by:
        correct in class CharFilter
        Parameters:
        currentOff - current offset
        Returns:
        corrected offset
      • getLastCumulativeDiff

        protected int getLastCumulativeDiff()
      • addOffCorrectMap

        protected void addOffCorrectMap​(int off,
                                        int cumulativeDiff)

        Adds an offset correction mapping at the given output stream offset.

        Assumption: the offset given with each successive call to this method will not be smaller than the offset given at the previous invocation.

        Parameters:
        off - The output stream offset at which to apply the correction
        cumulativeDiff - The input offset is given by adding this to the output offset