?? production.java
字號:
package ooad.observe;
import java.util.*;
public class Production {
private double price;
private String name;
private HashSet<Observer> observers;
public Production(String name,double price){
this.name=name;
this.price=price;
observers=new HashSet<Observer>();
}
public double getPrice() {
return price;
}
public void addObserver(Observer obs){
observers.add(obs);
}
public String getName() {
return name;
}
public void setPrice(double price) {
this.price = price;
for(Observer obs:observers){
obs.update(this);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -