Datasets:
ArXiv:
License:
Download data/test/Hugo-Gao/Design-pattern/Compound Pattern/src/Bean/RedheadDuck.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 588 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/test/Hugo-Gao/Design-pattern/Compound%20Pattern/src/Bean/RedheadDuck.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo/data/test/Hugo-Gao/Design-pattern/Compound Pattern/src/Bean/RedheadDuck.java'
-
curl -L -o RedheadDuck.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/test/Hugo-Gao/Design-pattern/Compound%20Pattern/src/Bean/RedheadDuck.java
588 Bytes
| package Bean; | |
| import Interface.Quackable; | |
| /** | |
| * Created by Administrator on 2017/7/14. | |
| */ | |
| public class RedheadDuck implements Quackable | |
| { | |
| public RedheadDuck() | |
| { | |
| observable = new Observable(this); | |
| } | |
| public void quack() | |
| { | |
| System.out.println("Quack"); | |
| notifyObservers(); | |
| } | |
| Observable observable; | |
| public void registerObserver(Interface.Observer observer) | |
| { | |
| observable.registerObserver(observer); | |
| } | |
| public void notifyObservers() | |
| { | |
| observable.notifyObservers(); | |
| } | |
| } | |