// Flatten class graph *********** UNFINISHED DO NOT USE ************ // *********** NOT INCLUDED IN .PRJ ************* Cd_graph { {{ public HashMap partMap; public void flatten_cg(ClassGraph cg) { partMap = this.computeParts(cg); Strategy s = new Strategy("from Cd_graph bypassing Alternat_ns to Any_vertex_List"); TraversalGraph tg = new TraversalGraph(s, cg); tg.traverse(this, new Visitor() { public Ident curAdj; public void start() { // Starts empty curAdj = new Ident(""); } public void before(Adjacency host){ curAdj = host.get_source().get_vertex_name(); } public void before (Any_vertex_List host) { // get parents Vector parents = (Vector) hashCheck.get(String.valueOf( host.get_vertex_name() )); Iterator parent = parents.iterator(); while (parent.hasNext()) { String s = (String) parent.next(); host.addAll( partMap.get(String.valueOf(s))); } } }); // End of traversal // Now remove the common parts this.removeCommon(cg); } //end of flatten_cg public void removeCommon(ClassGraph cg) { // Remove all common parts of abstract classes Strategy s = new Strategy("from Cd_graph through Alternat_ns to Any_vertex_List"); TraversalGraph tg = new TraversalGraph( s, cg); tg.traverse(this, new Visitor() { public void before (Any_vertex_List host) { host = new Any_vertex_List(); } }); // End traverse } // End removeCommonParts() }} } //end of Cd_graph