Cd_graph { {{ public HashMap parents = new HashMap(); public String getParent(String pname) { return (String) parents.get(String.valueOf(pname)); } public void multipleInheritance(ClassGraph cg) { Strategy sg = new Strategy("from Cd_graph through Term_Bar_list to Vertex"); TraversalGraph tg = new TraversalGraph(sg,cg); tg.traverse( this, new Visitor() { Ident curAdj; public void start() { // Starts as empty curAdj = new Ident(""); } public void before(Adjacency host){ curAdj = host.get_source().get_vertex_name(); } public void before(Vertex host) { // get parent of host String parent = getParent(host.get_vertex_name().toString()); if ( parent == null ) { // Put in hashmap parents.put( host.get_vertex_name().toString(), curAdj.toString() ); } else { if( parent != curAdj.toString() ) System.err.println("*** ERROR DETECTED: The class "+ host.get_vertex_name().toString() + " has two super classes: " + parent + ", " + curAdj.toString() + "." ); } } }); } }} }