老师留的作业题,实在是头疼。import java.util.*;
public class Controller {
 private LinkedList<Event> eventList = new LinkedList<Event>();
 public void addEvent(Event c) { eventList.add(c); }   
 public void run() {   
  LinkedList<Event> eventListCopy =  
  new LinkedList<Event>(eventList);
  ListIterator<Event> it  
  = eventListCopy.listIterator();
  while(it.hasNext()) {  
  Event e = it.next();
  e.action(); //action()函数会调用addEvent()函数添加元素
  System.out.println(e.description()); //输出状态   
  }
 }  
}主函数:
 public static void main(String[] args) {
  GreenhouseControls gc = //类GreenhouseControls继承自Controller
  new GreenhouseControls();
  long tm = System.currentTimeMillis();
  gc.addEvent(gc.new Restart(tm));
  gc.run();
  }  
=====================================================
action()函数利用addEvent()添加一系列元素
但是在while()中却只能输出第一个元素,为什么?
=====================================================
参考资料:《Thinking in Java 4th》(中文版) 第11章 练习13