progtech zh
This commit is contained in:
16
Java/zh/HotDrinkDecorator.java
Normal file
16
Java/zh/HotDrinkDecorator.java
Normal file
@ -0,0 +1,16 @@
|
||||
// Decorátor
|
||||
abstract class HotDrinkDecorator extends HotDrink {
|
||||
HotDrink wrappedObject = null;
|
||||
|
||||
public int getBoilingTemperature() {
|
||||
return wrappedObject.getBoilingTemperature();
|
||||
}
|
||||
|
||||
public String getKeyComponent() {
|
||||
return wrappedObject.getKeyComponent();
|
||||
}
|
||||
|
||||
public HotDrinkDecorator(HotDrink wo) {
|
||||
wrappedObject = wo;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user