summaryrefslogtreecommitdiffstats
path: root/src/test/misc/en/Operation.java
diff options
context:
space:
mode:
authorStiver <stiver.mail@gmail.com>2014-03-04 15:13:11 +0100
committerStiver <stiver.mail@gmail.com>2014-03-04 15:13:11 +0100
commite2d0f5d9c38561d67f23754c00addb4a3547efb2 (patch)
tree1832f16037c086b48266b8566aecc61f45f4e5f1 /src/test/misc/en/Operation.java
downloadfernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.tar
fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.tar.gz
fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.tar.lz
fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.tar.xz
fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.zip
initial commit
Diffstat (limited to 'src/test/misc/en/Operation.java')
-rw-r--r--src/test/misc/en/Operation.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/test/misc/en/Operation.java b/src/test/misc/en/Operation.java
new file mode 100644
index 0000000..3051fb3
--- /dev/null
+++ b/src/test/misc/en/Operation.java
@@ -0,0 +1,51 @@
+package test.misc.en;
+
+public enum Operation {
+
+ PLUS(2) {
+ double eval(double x, double y) { return x + y; }
+ },
+ MINUS(7) {
+ double eval(double x, double y) { return x - y; }
+ },
+ TIMES(8) {
+ double eval(double x, double y) { return x * y; }
+ },
+ DIVIDED_BY(0) {
+ double eval(double x, double y) { return x / y; }
+ };
+
+
+ // Perform the arithmetic operation represented by this constant
+
+ abstract double eval(double x, double y);
+
+ Operation(int t) {
+
+// class LocalClass {
+//
+// }
+//
+// LocalClass e = null;
+
+ System.out.println();
+ }
+
+
+ public static void main(String args[]) {
+ double x = Double.parseDouble(args[0]);
+ double y = Double.parseDouble(args[1]);
+
+ Operation opp = Operation.DIVIDED_BY;
+
+ switch(opp) {
+ case MINUS:
+ System.out.println();
+ case PLUS:
+ }
+
+ for (Operation op : Operation.values()) {
+ System.out.println(x + " " + op + " " + y + " = " + op.eval(x, y));
+ }
+ }
+} \ No newline at end of file