Cd_graph { {{ public void checkUniquePartNames(final ClassGraph cg) { Strategy s = new Strategy("from Cd_graph to {Regular,Labeled}"); cg.traverse(this, s, new Visitor() { HashSet partNames; // Temporary set of part names String currAdj; // Trail variable public void before (Adjacency host){ partNames = new HashSet(); // Clear HashSet currAdj = host.get_source().get_vertex_name().toString(); } public void before (Regular host) { AddToParts(host.get_vertex().get_vertex().get_vertex_name().toString().toLowerCase()); } public void before (Labeled host) { AddToParts( host.get_label_name().toString() ); } private void AddToParts (String add) { if (partNames.contains(add)) { System.out.println(" *** ERROR: Part " + add + " of class " +currAdj + " is not unique"); } else { partNames.add(add); }; } }); // End of traverse }//End of function }} }