removed enum

This commit is contained in:
Claudio Maggioni 2023-01-09 18:05:26 +01:00
parent 783b90bdd2
commit 2de11a50ec

View file

@ -1,33 +0,0 @@
package ex8;
import org.objectweb.asm.Opcodes;
import java.util.HashMap;
public enum InvokeType {
STATIC("static"),
DYNAMIC("dynamic"),
SPECIAL("special"),
VIRTUAL("virtual");
final String name;
final static HashMap<Integer, InvokeType> opcodeToInvokeType = new HashMap<>() {
{
put(Opcodes.INVOKESTATIC, InvokeType.STATIC);
put(Opcodes.INVOKEDYNAMIC, InvokeType.DYNAMIC);
put(Opcodes.INVOKESPECIAL, InvokeType.SPECIAL);
put(Opcodes.INVOKEVIRTUAL, InvokeType.VIRTUAL);
}
};
InvokeType(String name) {
this.name = name;
}
static InvokeType fromOpcode(int opCode) {
return opcodeToInvokeType.get(opCode);
}
}