import edu.neu.ccs.demeter.dj.*; import java.io.*; class A{ protected B b1; protected C c1; protected D d1; public void set_b(B b_passed){ b1 = b_passed; } public void set_c(C c_passed){ c1 = c_passed; } public void set_d(D d_passed){ d1 = d_passed; } public B get_b(){ return b1; } public C get_c(){ return c1; } public D get_d(){ return d1; } public A() { super(); } public A(B b1, C c1, D d) { super(); set_b(b1); set_c(c1); set_d(d); } //****************************************************** //assuming that there will always be a D object passed //but would overload the constructor to accept an A //object that only has the B and C objects to initialize //sent e-mail and awaitning notification //****************************************************** //public A(B b1, C c1) { // super(); // set_b1(b1); // set_c1(c1); //} //****************************************************** void print(){ ClassGraph cg = new ClassGraph(true, false); TraversalGraph tg = new TraversalGraph("from A to *", cg); System.out.println(cg); System.out.println(tg); //Main.cg must be defined within the main function. //Traverses the A object with the print visitor tg.traverse(this, new myPrintVisitor()); System.out.println("hey it's the traversal"); } //end of class A } //B is an abstract class and for this assignment //E and F will extend this class abstract class B { public B() { super(); } } class C { public C(){ super(); } } class D { public D(){ super(); } } class E extends B { public E(){ super(); } } class F extends B{ private G g1; private H h1; private A a_in_F; public void set_g(G g_passed){ g1 = g_passed; } public void set_h(H h_passed){ h1 = h_passed; } public void set_a(A a_passed){ a_in_F = a_passed; } public G get_g(){ return g1; } public H get_h(){ return h1; } public A get_a(){ return a_in_F; } public F(G g, H h, A a){ set_g(g); set_h(h); set_a(a); } } class G { public G(){ super(); } } class H { public H(){ super(); } } class Main { public Main() { super(); } static public void main(String args[]) throws Exception { E einmain = new E(); C cinmain = new C(); D dinmain = new D(); // A a = new A ( new F(new G(), new H(), new A(new E(), new C(), new D())), new C(), null); A ainmain = new A(einmain, cinmain, dinmain); ainmain.print(); System.out.println("Main Program hello"); } }