public class VacationVisitor extends Visitor
{
 protected int total_days;
 public VacationVisitor()
 {
   total_days = 0;
 }
 //-----------------------------
 public void visit(Employee emp) {
    total_days += emp.getVacDays();                   
    //special test in catch-all parent class
    if(emp instanceof Manager)
        total_days += ((Manager) emp).getBonusDays ();
 }
 //-----------------------------
 public void visit(Boss boss)
 {
    total_days += boss.getVacDays();
 }
 //-----------------------------                             
 public int getTotalDays()
 {
    return total_days;
 }
}
