?? controller13.java
字號(hào):
// holding/Controller13.java
// TIJ4 Chapter Holding, Exercise 13, page 412
/* In the innerclasses/GreenhouseController.java example, the class
* Controller uses an ArrayList. Change the code to use a LinkedList
* instead, and use an Iterator to cycle through the set of events.
*/
import java.util.*;
public class Controller13 {
// A class from java.util to hold Event objects:
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()) {
it.next().action();
it.previous();
System.out.println(it.next());
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -