public Object visitVComponent(VNote vn, Object arg) throws VisitorException { Object result = arg; Iterator pIter = vn.getAllProperties().iterator(); while (pIter.hasNext()) { VisitorInterface p = (VisitorInterface) pIter.next(); result = p.accept(this, result); } return result; }
public Object visitProperty(Property p, Object arg) throws VisitorException { Object result = arg; Iterator pIter = p.getParameters().iterator(); while (pIter.hasNext()) { VisitorInterface prmtr = (VisitorInterface) pIter.next(); result = prmtr.accept(this, result); } return result; }
public Object visitVCalendar(VCalendar vc, Object arg) throws VisitorException { Object result = arg; Iterator pIter = vc.getAllProperties().iterator(); while (pIter.hasNext()) { VisitorInterface p = (VisitorInterface) pIter.next(); result = p.accept(this, result); } Iterator cIter = vc.getAllComponents().iterator(); while (cIter.hasNext()) { VisitorInterface c = (VisitorInterface) cIter.next(); result = c.accept(this, result); } return result; }
@Override public void accept(VisitorInterface visitor) { visitor.visit(this); }
// Step 1.c.ii - ii. Implement the accept() method. @Override public void accept(VisitorInterface f) { // Step 1.c.iii. The call to execute(). Pass "this" reference f.execute(this); }