Class Differ<T>


  • public final class Differ<T>
    extends Object
    VERY Basic Diff program. Compares two sequences of objects fed into it, and lets you know where they are different.
    • Constructor Detail

      • Differ

        public Differ​(int stackSize,
                      int matchCount)
        Parameters:
        stackSize - The size of the largest difference you expect.
        matchCount - The number of items that have to be the same to count as a match
    • Method Detail

      • add

        public void add​(T aStr,
                        T bStr)
      • addA

        public void addA​(T aStr)
      • addB

        public void addB​(T bStr)
      • getALine

        public int getALine​(int offset)
      • getA

        public T getA​(int offset)
      • getACount

        public int getACount()
      • getBCount

        public int getBCount()
      • getBLine

        public int getBLine​(int offset)
      • getB

        public T getB​(int offset)
      • checkMatch

        public void checkMatch​(boolean finalPass)
      • find

        public int find​(T[] aArr,
                        int aStart,
                        int aEnd,
                        T[] bArr,
                        int bStart,
                        int bEnd)
        Convenient utility finds a segment of the first array in the second array.
        Returns:
        -1 if not found, otherwise start position in b