Datasets:
ArXiv:
License:
Download data/test/Hugo-Gao/Design-pattern/TemplatePattern/src/CaffeineBeverage.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 584 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/test/Hugo-Gao/Design-pattern/TemplatePattern/src/CaffeineBeverage.java
- Command line
-
hf download hf://datasets/RepoFusion/Stack-Repo/data/test/Hugo-Gao/Design-pattern/TemplatePattern/src/CaffeineBeverage.java
-
curl -L -o CaffeineBeverage.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/test/Hugo-Gao/Design-pattern/TemplatePattern/src/CaffeineBeverage.java
584 Bytes
| /** | |
| * Created by Administrator on 2017/7/11. | |
| */ | |
| public abstract class CaffeineBeverage | |
| { | |
| final void prepareRecipe() | |
| { | |
| boilWater(); | |
| brew(); | |
| pourInCup(); | |
| if(customerWantsCondiments()) | |
| { | |
| addCondiment(); | |
| } | |
| } | |
| boolean customerWantsCondiments() | |
| { | |
| return true; | |
| } | |
| abstract void brew(); | |
| abstract void addCondiment(); | |
| final void pourInCup() | |
| { | |
| System.out.println("倒进杯子里"); | |
| } | |
| final void boilWater() | |
| { | |
| System.out.println("煮开水"); | |
| } | |
| } | |