Class FileLineDifferenceIterator

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<java.lang.String>

    public class FileLineDifferenceIterator
    extends java.lang.Object
    implements java.io.Closeable, java.util.Iterator<java.lang.String>
    FileLineDifferenceIterator class which iterates over the difference of 2 files line by line. If there is a scope for lines in the files containing line break characters it should be ensured that both the files are written with FileIOUtils.writeAsLine(BufferedWriter, String, boolean) with true to escape line break characters.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileLineDifferenceIterator​(java.io.File marked, java.io.File available, @Nullable java.util.function.Function<java.lang.String,​java.lang.String> transformer)  
      FileLineDifferenceIterator​(org.apache.commons.io.LineIterator marked, org.apache.commons.io.LineIterator available)  
      FileLineDifferenceIterator​(org.apache.commons.io.LineIterator marked, org.apache.commons.io.LineIterator available, @Nullable java.util.function.Function<java.lang.String,​java.lang.String> transformer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      boolean hasNext()  
      java.lang.String next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • FileLineDifferenceIterator

        public FileLineDifferenceIterator​(org.apache.commons.io.LineIterator marked,
                                          org.apache.commons.io.LineIterator available,
                                          @Nullable
                                          @Nullable java.util.function.Function<java.lang.String,​java.lang.String> transformer)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • FileLineDifferenceIterator

        public FileLineDifferenceIterator​(java.io.File marked,
                                          java.io.File available,
                                          @Nullable
                                          @Nullable java.util.function.Function<java.lang.String,​java.lang.String> transformer)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • FileLineDifferenceIterator

        public FileLineDifferenceIterator​(org.apache.commons.io.LineIterator marked,
                                          org.apache.commons.io.LineIterator available)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<java.lang.String>
      • next

        public java.lang.String next()
        Specified by:
        next in interface java.util.Iterator<java.lang.String>
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException