//Accessor function to set what the robot will construct public void setWhatToAssemble(GuitarComponent whatToAssemble) { this.whatToAssemble = whatToAssemble; this.compositeIterator = new CompositeIterator(whatToAssemble.createIterator()); }
//Public constructor, names the robot and tells it what to assemble public Robot(String whichRobot, GuitarComponent whatToAssemble) { this.whichRobot = whichRobot; this.whatToAssemble = whatToAssemble; this.compositeIterator = new CompositeIterator(whatToAssemble.createIterator()); }