import com.seanhandley.projects.BinaryTree.IVisitor; /** * Visitor for a Plane. * * @author Sean Handley, 320097@swan.ac.uk * @version May 2007 */ public class PlaneVisitor1 implements IVisitor<Plane,String> { private boolean found = false; private String man = ""; /** * Find first planes of length 40's manufacturer */ public String node(Plane plane) { //see if a plane of length 10 exists if(!found) { if(plane.length == 10) { found = true; man = plane.manufacturer; return man; } else { return "not found"; } } else { return man; } } }