Package ptolemy.util

Class Diff

    • Constructor Summary

      Constructors 
      Constructor Description
      Diff()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String diff​(java.lang.String aString, java.lang.String bString)
      Return the difference between two strings.
      static void main​(java.lang.String[] args)
      Print the difference between two files.
      • Methods inherited from class java.lang.Object

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

      • Diff

        public Diff()
    • Method Detail

      • diff

        public static java.lang.String diff​(java.lang.String aString,
                                            java.lang.String bString)
        Return the difference between two strings.
        Parameters:
        aString - The first string to be compared.
        bString - The secondString to be compared
        Returns:
        A string describing the difference between the two strings in a format similar to the Unix diff command.
      • main

        public static void main​(java.lang.String[] args)
                         throws java.net.MalformedURLException,
                                java.io.IOException
        Print the difference between two files.

        Usage:

          java -classpath $PTII ptolemy.util.test.Diff File1.txt File2.txt
          
        Parameters:
        args - An array of two elements, where the first element is the filename of the first file and the second element is the filename of the second file.
        Throws:
        java.net.MalformedURLException - If a file name cannot be converted into a URL.
        java.io.IOException - If a file cannot be read.