Interface ConvertInstruction
- All Superinterfaces:
- ClassFileElement,- CodeElement,- Instruction
Models a primitive conversion instruction in the 
 where these conversions are valid:
 
code array of a
 Code attribute, such as i2l.  Corresponding opcodes
 have a kind of Opcode.Kind.CONVERT.
 Delivered as a CodeElement when traversing the elements of a CodeModel.
 A primitive conversion instruction is composite:
ConvertInstruction(
    TypeKind fromType,
    TypeKind toType
)
- Between int,long,float, anddouble, wherefromType != toType;
- From inttobyte,char, andshort.
- Since:
- 24
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionfromType()Returns the source type to convert from.static ConvertInstructionReturns a conversion instruction.static ConvertInstructionReturns a conversion instruction.toType()Returns the destination type to convert to.Methods declared in interface java.lang.classfile.Instructionopcode, sizeInBytes
- 
Method Details- 
fromTypeTypeKind fromType()Returns the source type to convert from.- Returns:
- the source type to convert from
 
- 
toTypeTypeKind toType()Returns the destination type to convert to.- Returns:
- the destination type to convert to
 
- 
ofReturns a conversion instruction. Valid conversions are:- Between int,long,float, anddouble, wherefromType != toType;
- From inttobyte,char, andshort.
 - Parameters:
- fromType- the type to convert from
- toType- the type to convert to
- Returns:
- a conversion instruction
- Throws:
- IllegalArgumentException- if this is not a valid conversion
 
- Between 
- 
ofReturns a conversion instruction.- Parameters:
- op- the opcode for the specific type of conversion instruction, which must be of kind- Opcode.Kind.CONVERT
- Returns:
- a conversion instruction
- Throws:
- IllegalArgumentException- if the opcode kind is not- Opcode.Kind.CONVERT.
 
 
-