From 5e2ef196151cadb51ccc17f1dbe0e73b6408c008 Mon Sep 17 00:00:00 2001 From: blha303 Date: Sun, 10 Nov 2013 23:41:03 +0800 Subject: Added package --- src/main/java/Potato.java | 53 -------------------------------- src/main/java/Tuber.java | 3 -- src/main/java/org/drtshock/Potato.java | 55 ++++++++++++++++++++++++++++++++++ src/main/java/org/drtshock/Tuber.java | 5 ++++ 4 files changed, 60 insertions(+), 56 deletions(-) delete mode 100644 src/main/java/Potato.java delete mode 100644 src/main/java/Tuber.java create mode 100644 src/main/java/org/drtshock/Potato.java create mode 100644 src/main/java/org/drtshock/Tuber.java (limited to 'src/main') diff --git a/src/main/java/Potato.java b/src/main/java/Potato.java deleted file mode 100644 index 9a35df0..0000000 --- a/src/main/java/Potato.java +++ /dev/null @@ -1,53 +0,0 @@ -import java.util.List; -import java.util.ArrayList; - -public class Potato implements Tuber { - - private final List condiments = new ArrayList(); - - 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", "crumbled bacon", "grated cheese"); - 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 deleted file mode 100644 index ec36f28..0000000 --- a/src/main/java/Tuber.java +++ /dev/null @@ -1,3 +0,0 @@ -public interface Tuber { - public boolean isDelicious(); -} diff --git a/src/main/java/org/drtshock/Potato.java b/src/main/java/org/drtshock/Potato.java new file mode 100644 index 0000000..adb3321 --- /dev/null +++ b/src/main/java/org/drtshock/Potato.java @@ -0,0 +1,55 @@ +package org.drtshock; + +import java.util.List; +import java.util.ArrayList; + +public class Potato implements Tuber { + + private final List condiments = new ArrayList(); + + 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", "crumbled bacon", "grated cheese"); + 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/org/drtshock/Tuber.java b/src/main/java/org/drtshock/Tuber.java new file mode 100644 index 0000000..8b4bd5a --- /dev/null +++ b/src/main/java/org/drtshock/Tuber.java @@ -0,0 +1,5 @@ +package org.drtshock; + +public interface Tuber { + public boolean isDelicious(); +} -- cgit v1.3