//遍历访问员工集合中的每一个员工对象
 public void accept(Department handler)
 {
     foreach (Employee obj in list)
     {
         obj.accept(handler);
     }
 }
示例#2
0
 /// <summary>
 /// 接受一个抽象访问者访问
 /// </summary>
 /// <param name="handler"></param>
 public abstract void accept(Department handler);