Skip to content

Instantly share code, notes, and snippets.

@schwarzeszeux
Created April 11, 2012 10:38
Show Gist options
  • Save schwarzeszeux/2358570 to your computer and use it in GitHub Desktop.
Save schwarzeszeux/2358570 to your computer and use it in GitHub Desktop.
JavaMapper Decompiler
package Enums;
enum Operation {
PLUS("PLUS", 0, (Operation)null) {
double eval(double x, double y) {
return x + y;
}
},
MINUS("MINUS", 1, (Operation)null) {
double eval(double x, double y) {
return x - y;
}
},
TIMES("TIMES", 2, (Operation)null) {
double eval(double x, double y) {
return x * y;
}
},
DIVIDED_BY("DIVIDED_BY", 3, (Operation)null) {
double eval(double x, double y) {
return x / y;
}
};
// $FF: synthetic field
private static final Operation[] ENUM$VALUES = new Operation[]{PLUS, MINUS, TIMES, DIVIDED_BY};
private Operation(String var1, int var2) {}
abstract double eval(double var1, double var3);
// $FF: synthetic method
Operation(String var1, int var2, Operation var3) {
this(var1, var2);
}
}
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: Operation.java
package Enums;
abstract class Operation extends Enum
{
private Operation(String s, int i)
{
super(s, i);
}
abstract double eval(double d, double d1);
public static Operation[] values()
{
Operation aoperation[];
int i;
Operation aoperation1[];
System.arraycopy(aoperation = ENUM$VALUES, 0, aoperation1 = new Operation[i = aoperation.length], 0, i);
return aoperation1;
}
public static Operation valueOf(String s)
{
return (Operation)Enum.valueOf(Enums/Operation, s);
}
Operation(String s, int i, Operation operation)
{
this(s, i);
}
public static final Operation PLUS;
public static final Operation MINUS;
public static final Operation TIMES;
public static final Operation DIVIDED_BY;
private static final Operation ENUM$VALUES[];
static
{
PLUS = new Operation("PLUS", 0) {
double eval(double x, double y)
{
return x + y;
}
}
;
MINUS = new Operation("MINUS", 1) {
double eval(double x, double y)
{
return x - y;
}
}
;
TIMES = new Operation("TIMES", 2) {
double eval(double x, double y)
{
return x * y;
}
}
;
DIVIDED_BY = new Operation("DIVIDED_BY", 3) {
double eval(double x, double y)
{
return x / y;
}
}
;
ENUM$VALUES = (new Operation[] {
PLUS, MINUS, TIMES, DIVIDED_BY
});
}
}
package Enums;
enum Operation
{
PLUS {
double eval(double a0, double a1)
{
return a0 + a1;
}
},
MINUS {
double eval(double a0, double a1)
{
return a0 - a1;
}
},
TIMES {
double eval(double a0, double a1)
{
return a0 * a1;
}
},
DIVIDED_BY {
double eval(double a0, double a1)
{
return a0 / a1;
}
};
abstract double eval(double a0, double a1);
}
package Enums;
enum Operation
{
PLUS,
MINUS,
TIMES,
DIVIDED_BY;
abstract double eval(double paramDouble1, double paramDouble2);
}
package Enums;
enum Operation {
PLUS {
double eval(double x, double y) { return x + y; }
},
MINUS {
double eval(double x, double y) { return x - y; }
},
TIMES {
double eval(double x, double y) { return x * y; }
},
DIVIDED_BY {
double eval(double x, double y) { return x / y; }
};
// Each constant supports an arithmetic operation
abstract double eval(double x, double y);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment