Package com.tonic.analysis.instruction
Enum ConversionInstruction.ConversionType
- java.lang.Object
-
- java.lang.Enum<ConversionInstruction.ConversionType>
-
- com.tonic.analysis.instruction.ConversionInstruction.ConversionType
-
- All Implemented Interfaces:
Serializable,Comparable<ConversionInstruction.ConversionType>
- Enclosing class:
- ConversionInstruction
public static enum ConversionInstruction.ConversionType extends Enum<ConversionInstruction.ConversionType>
The widening conversion kinds, each pairing a JVM opcode with its mnemonic.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description D2FNarrows a double to a float, rounding to nearest and overflowing to infinity.D2IConverts a double to an int, truncating toward zero and clamping to the int range; NaN becomes zero.D2LConverts a double to a long, truncating toward zero and clamping to the long range; NaN becomes zero.F2DWidens a float to a double without loss of value.F2IConverts a float to an int, truncating toward zero and clamping to the int range; NaN becomes zero.F2LConverts a float to a long, truncating toward zero and clamping to the long range; NaN becomes zero.I2DWidens an int to a double without loss of value.I2FConverts an int to a float, rounding to nearest when the magnitude exceeds 24 bits of precision.L2DConverts a long to a double, rounding to nearest when the magnitude exceeds 53 bits of precision.L2FConverts a long to a float, rounding to nearest when the magnitude exceeds 24 bits of precision.L2INarrows a long to an int by keeping only the low 32 bits.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConversionInstruction.ConversionTypefromOpcode(int opcode)Looks up the conversion type for a JVM opcode.StringgetMnemonic()intgetOpcode()static ConversionInstruction.ConversionTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ConversionInstruction.ConversionType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
I2F
public static final ConversionInstruction.ConversionType I2F
Converts an int to a float, rounding to nearest when the magnitude exceeds 24 bits of precision.
-
I2D
public static final ConversionInstruction.ConversionType I2D
Widens an int to a double without loss of value.
-
L2I
public static final ConversionInstruction.ConversionType L2I
Narrows a long to an int by keeping only the low 32 bits.
-
L2F
public static final ConversionInstruction.ConversionType L2F
Converts a long to a float, rounding to nearest when the magnitude exceeds 24 bits of precision.
-
L2D
public static final ConversionInstruction.ConversionType L2D
Converts a long to a double, rounding to nearest when the magnitude exceeds 53 bits of precision.
-
F2I
public static final ConversionInstruction.ConversionType F2I
Converts a float to an int, truncating toward zero and clamping to the int range; NaN becomes zero.
-
F2L
public static final ConversionInstruction.ConversionType F2L
Converts a float to a long, truncating toward zero and clamping to the long range; NaN becomes zero.
-
F2D
public static final ConversionInstruction.ConversionType F2D
Widens a float to a double without loss of value.
-
D2I
public static final ConversionInstruction.ConversionType D2I
Converts a double to an int, truncating toward zero and clamping to the int range; NaN becomes zero.
-
D2L
public static final ConversionInstruction.ConversionType D2L
Converts a double to a long, truncating toward zero and clamping to the long range; NaN becomes zero.
-
D2F
public static final ConversionInstruction.ConversionType D2F
Narrows a double to a float, rounding to nearest and overflowing to infinity.
-
-
Method Detail
-
values
public static ConversionInstruction.ConversionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ConversionInstruction.ConversionType c : ConversionInstruction.ConversionType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConversionInstruction.ConversionType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getOpcode
public int getOpcode()
- Returns:
- the opcode
-
getMnemonic
public String getMnemonic()
- Returns:
- the mnemonic
-
fromOpcode
public static ConversionInstruction.ConversionType fromOpcode(int opcode)
Looks up the conversion type for a JVM opcode.- Parameters:
opcode- the JVM opcode- Returns:
- the matching type, or null if the opcode is not a conversion opcode
-
-