prog.utils
Class ListUtils

java.lang.Object
  |
  +--prog.utils.ListUtils

public class ListUtils
extends java.lang.Object

This class provides a set of static methods for tasks related to Vectors.


Constructor Summary
ListUtils()
           
 
Method Summary
static java.util.Vector arrayToVector(java.lang.Object[] objArray)
          Returns a Vector containing the contents of the input array.
static java.util.Vector commonToLists(java.util.Vector vect1, java.util.Vector vect2)
          Returns a Vector of objects that exist in both input Vectors.
static void compareDirectories(java.lang.String path1, java.lang.String path2)
          Prints the names of those files not found in both directories and then prints the names of those files whose contents do not match.
static boolean filesMatch(java.lang.String filepath1, java.lang.String filepath2)
          Returns true if the file contents of the two files match.
static void main(java.lang.String[] args)
           
static java.util.Vector notInOtherList(java.util.Vector thisVect, java.util.Vector otherVect)
          Returns the list of objects in vector thisVect that are not in vector otherVect.
static java.util.Vector uniqueToLists(java.util.Vector vect1, java.util.Vector vect2)
          Returns the combined list of objects that are unique to the two input vectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListUtils

public ListUtils()
Method Detail

commonToLists

public static java.util.Vector commonToLists(java.util.Vector vect1,
                                             java.util.Vector vect2)
Returns a Vector of objects that exist in both input Vectors.

notInOtherList

public static java.util.Vector notInOtherList(java.util.Vector thisVect,
                                              java.util.Vector otherVect)
Returns the list of objects in vector thisVect that are not in vector otherVect.

uniqueToLists

public static java.util.Vector uniqueToLists(java.util.Vector vect1,
                                             java.util.Vector vect2)
Returns the combined list of objects that are unique to the two input vectors.

filesMatch

public static boolean filesMatch(java.lang.String filepath1,
                                 java.lang.String filepath2)
Returns true if the file contents of the two files match.

arrayToVector

public static java.util.Vector arrayToVector(java.lang.Object[] objArray)
Returns a Vector containing the contents of the input array.

compareDirectories

public static void compareDirectories(java.lang.String path1,
                                      java.lang.String path2)
Prints the names of those files not found in both directories and then prints the names of those files whose contents do not match.

Example:

Debug.setDebug(true);
String path1 = "c:/jed/prog/phoons/html/";
String path2 = "c:/jed/prog/phoons/html2/";
prog.utils.ListUtils.compareDirectories(path1, path2);

main

public static void main(java.lang.String[] args)