/* Research Project: Graphical Database for Category Theory J. Bradbury, Dr. R. Rosebrugh, I. Rutherford Mount Allison University 2001 File: EqualityComposites.java Description: This class contains the algorithms to test paths in a given category for equality. It is used only by the EqualityCompositesFrame class. */ //import statements public class EqualityComposites { private Category cat; public EqualityComposites(Category newCat) //Default Constructor with the list of categories as a parameter { cat = newCat; } public String equality_test(int[] p1, int[] p2) //This function determines if the two paths specified by the user //are equal or not equal. { //If the two reduced paths are equals String result = cat.path_to_string(p1) + " and " + cat.path_to_string(p2) + " are "; if (cat.equals(cat.reduce(p1), cat.reduce(p2))) {} else result+="NOT"; return result+" equal."; } }