本文整理汇总了Java中com.sun.org.apache.bcel.internal.generic.Type.BYTE属性的典型用法代码示例。如果您正苦于以下问题:Java Type.BYTE属性的具体用法?Java Type.BYTE怎么用?Java Type.BYTE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.org.apache.bcel.internal.generic.Type
的用法示例。
在下文中一共展示了Type.BYTE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadLocal
/**
* Helper method to generate an instance of a subclass of
* {@link LoadInstruction} based on the specified {@link Type} that will
* load the specified local variable
* @param index the JVM stack frame index of the variable that is to be
* loaded
* @param type the {@link Type} of the variable
* @return the generated {@link LoadInstruction}
*/
private static Instruction loadLocal(int index, Type type) {
if (type == Type.BOOLEAN) {
return new ILOAD(index);
} else if (type == Type.INT) {
return new ILOAD(index);
} else if (type == Type.SHORT) {
return new ILOAD(index);
} else if (type == Type.LONG) {
return new LLOAD(index);
} else if (type == Type.BYTE) {
return new ILOAD(index);
} else if (type == Type.CHAR) {
return new ILOAD(index);
} else if (type == Type.FLOAT) {
return new FLOAD(index);
} else if (type == Type.DOUBLE) {
return new DLOAD(index);
} else {
return new ALOAD(index);
}
}
示例2: storeLocal
/**
* Helper method to generate an instance of a subclass of
* {@link StoreInstruction} based on the specified {@link Type} that will
* store a value in the specified local variable
* @param index the JVM stack frame index of the variable that is to be
* stored
* @param type the {@link Type} of the variable
* @return the generated {@link StoredInstruction}
*/
private static Instruction storeLocal(int index, Type type) {
if (type == Type.BOOLEAN) {
return new ISTORE(index);
} else if (type == Type.INT) {
return new ISTORE(index);
} else if (type == Type.SHORT) {
return new ISTORE(index);
} else if (type == Type.LONG) {
return new LSTORE(index);
} else if (type == Type.BYTE) {
return new ISTORE(index);
} else if (type == Type.CHAR) {
return new ISTORE(index);
} else if (type == Type.FLOAT) {
return new FSTORE(index);
} else if (type == Type.DOUBLE) {
return new DSTORE(index);
} else {
return new ASTORE(index);
}
}