Package com.tonic.analysis.instruction
Enum NarrowingConversionInstruction.NarrowingType
- java.lang.Object
-
- java.lang.Enum<NarrowingConversionInstruction.NarrowingType>
-
- com.tonic.analysis.instruction.NarrowingConversionInstruction.NarrowingType
-
- All Implemented Interfaces:
Serializable,Comparable<NarrowingConversionInstruction.NarrowingType>
- Enclosing class:
- NarrowingConversionInstruction
public static enum NarrowingConversionInstruction.NarrowingType extends Enum<NarrowingConversionInstruction.NarrowingType>
The narrowing conversion kinds, each pairing a JVM opcode with its mnemonic.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NarrowingConversionInstruction.NarrowingTypefromOpcode(int opcode)Looks up the narrowing type for a JVM opcode.StringgetMnemonic()intgetOpcode()static NarrowingConversionInstruction.NarrowingTypevalueOf(String name)Returns the enum constant of this type with the specified name.static NarrowingConversionInstruction.NarrowingType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
I2B
public static final NarrowingConversionInstruction.NarrowingType I2B
Truncates an int to 8 bits and sign-extends it back, the byte conversion.
-
I2C
public static final NarrowingConversionInstruction.NarrowingType I2C
Truncates an int to 16 bits and zero-extends it back, the char conversion.
-
I2S
public static final NarrowingConversionInstruction.NarrowingType I2S
Truncates an int to 16 bits and sign-extends it back, the short conversion.
-
-
Method Detail
-
values
public static NarrowingConversionInstruction.NarrowingType[] 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 (NarrowingConversionInstruction.NarrowingType c : NarrowingConversionInstruction.NarrowingType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NarrowingConversionInstruction.NarrowingType 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 NarrowingConversionInstruction.NarrowingType fromOpcode(int opcode)
Looks up the narrowing type for a JVM opcode.- Parameters:
opcode- the JVM opcode- Returns:
- the matching type, or null if the opcode is not I2B, I2C, or I2S
-
-