diff options
| author | blha303 <stevensmith.ome@gmail.com> | 2013-11-10 16:55:52 +0800 |
|---|---|---|
| committer | drtshock <drtshock13@gmail.com> | 2013-11-10 03:01:01 -0600 |
| commit | 62b45b0590b69c5b0feee63b751c4d15776f70da (patch) | |
| tree | 4be7fc90cb4436b94d1b31d94fe10e9ba2893fb3 /src/main | |
| parent | c760dfd114949aabd277c8a7e09d80379737d350 (diff) | |
Mavenized
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/java/Potato.java | 53 | ||||
| -rw-r--r-- | src/main/java/Tuber.java | 3 | ||||
| -rw-r--r-- | src/main/resources/5728853850_a3bbb14083_z.jpg | bin | 0 -> 65939 bytes | |||
| -rw-r--r-- | src/main/resources/lovethepotato.jpg | bin | 0 -> 73078 bytes | |||
| -rw-r--r-- | src/main/resources/sourcream.png | bin | 0 -> 64151 bytes |
5 files changed, 56 insertions, 0 deletions
diff --git a/src/main/java/Potato.java b/src/main/java/Potato.java new file mode 100644 index 0000000..399cdda --- /dev/null +++ b/src/main/java/Potato.java @@ -0,0 +1,53 @@ +import java.util.List; +import java.util.ArrayList; + +public class Potato implements Tuber { + + private final List<Condiment> condiments = new ArrayList<Condiment>(); + + public static void main(String[] args) { + Potato potato = new Potato(); + GLaDOS glados = new GLaDOS(); + if (potato.prepare()) System.out.println("Of course potato is prepared and delicious."); + else System.err.println("Fatal error! How could potato not be delicious?"); + } + + public boolean prepare() { + this.addCondiments("sour cream", "chives", "butter"); + return this.isDelicious(); + } + + public void addCondiments(String... names) { + synchronized (condiments) { + for (String condimentName : names) condiments.add(new Condiment(condimentName)); + } + } + + @Override + public boolean isDelicious() { + return true; // obviously, potatos are always delicious + } + + private class Condiment { + private final String name; + + public Condiment(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + } + + private static class GLaDOS extends Potato { + public GLaDOS() { + System.out.println("Oh hi, how are you holding up? BECAUSE I'M A POTATO... clap clap clap... oh good, my slow clap processor made it into this thing, at least we have that."); + } + + @Override + public boolean isDelicious() { + return false; // robots are not delicious + } + } +} diff --git a/src/main/java/Tuber.java b/src/main/java/Tuber.java new file mode 100644 index 0000000..ec36f28 --- /dev/null +++ b/src/main/java/Tuber.java @@ -0,0 +1,3 @@ +public interface Tuber { + public boolean isDelicious(); +} diff --git a/src/main/resources/5728853850_a3bbb14083_z.jpg b/src/main/resources/5728853850_a3bbb14083_z.jpg Binary files differnew file mode 100644 index 0000000..6791074 --- /dev/null +++ b/src/main/resources/5728853850_a3bbb14083_z.jpg diff --git a/src/main/resources/lovethepotato.jpg b/src/main/resources/lovethepotato.jpg Binary files differnew file mode 100644 index 0000000..20165e2 --- /dev/null +++ b/src/main/resources/lovethepotato.jpg diff --git a/src/main/resources/sourcream.png b/src/main/resources/sourcream.png Binary files differnew file mode 100644 index 0000000..d00f648 --- /dev/null +++ b/src/main/resources/sourcream.png |
