?? apartmentrentedstate.java
字號(hào):
public class ApartmentRentedState implements State
{
AutomatInterface automat;
public ApartmentRentedState(AutomatInterface d)
{
automat = d;
}
public String gotApplication()
{
return "Hang on, we're renting you an apartment.";
}
public String checkApplication()
{
return "Hang on, we're renting you an apartment.";
}
public String rentApartment()
{
automat.setCount(automat.getCount() - 1);
return "Renting you an apartment....";
}
public String dispenseKeys()
{
if(automat.getCount() <= 0){
automat.setState(automat.getFullyRentedState());
} else {
automat.setState(automat.getWaitingState());
}
return "Here are your keys!";
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -