本文整理汇总了Java中com.sun.org.apache.bcel.internal.classfile.Constant类的典型用法代码示例。如果您正苦于以下问题:Java Constant类的具体用法?Java Constant怎么用?Java Constant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Constant类属于com.sun.org.apache.bcel.internal.classfile包,在下文中一共展示了Constant类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: replaceConstantPool
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/** Replace all references to the old constant pool with references to the new
* constant pool
*/
public void replaceConstantPool(ConstantPoolGen old_cp, ConstantPoolGen new_cp) {
for(InstructionHandle ih=start; ih != null; ih = ih.next) {
Instruction i = ih.instruction;
if(i instanceof CPInstruction) {
CPInstruction ci = (CPInstruction)i;
Constant c = old_cp.getConstant(ci.getIndex());
ci.setIndex(new_cp.addConstant(c, old_cp));
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:InstructionList.java
示例2: adjustSize
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/**
* Resize internal array of constants.
*/
protected void adjustSize() {
if (index + 3 >= size) {
final Constant[] cs = constants;
size *= 2;
constants = new Constant[size];
System.arraycopy(cs, 0, constants, 0, index);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:ConstantPoolGen.java
示例3: toString
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/**
* @return mnemonic for instruction with symbolic references resolved
*/
@Override
public String toString( final ConstantPool cp ) {
final Constant c = cp.getConstant(super.getIndex());
final StringTokenizer tok = new StringTokenizer(cp.constantToString(c));
return Const.getOpcodeName(super.getOpcode()) + " " + tok.nextToken().replace('.', '/')
+ tok.nextToken();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:InvokeInstruction.java
示例4: replaceConstantPool
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/**
* Replace all references to the old constant pool with references to the
* new constant pool
*/
public void replaceConstantPool(final ConstantPoolGen old_cp, final ConstantPoolGen new_cp) {
for (InstructionHandle ih = start; ih != null; ih = ih.getNext()) {
final Instruction i = ih.getInstruction();
if (i instanceof CPInstruction) {
final CPInstruction ci = (CPInstruction) i;
final Constant c = old_cp.getConstant(ci.getIndex());
ci.setIndex(new_cp.addConstant(c, old_cp));
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:InstructionList.java
示例5: toString
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/**
* @return mnemonic for instruction with symbolic references resolved
*/
@Override
public String toString(final ConstantPool cp) {
final Constant c = cp.getConstant(index);
String str = cp.constantToString(c);
if (c instanceof ConstantClass) {
str = str.replace('.', '/');
}
return com.sun.org.apache.bcel.internal.Const.getOpcodeName(super.getOpcode()) + " " + str;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:CPInstruction.java
示例6: setValue
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
private void setValue(final int index) {
final ConstantPool cp = super.getConstantPool().getConstantPool();
final Constant c = cp.getConstant(index);
value = ((ConstantObject) c).getConstantValue(cp);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:FieldGen.java
示例7: ConstantPoolGen
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/**
* Create empty constant pool.
*/
public ConstantPoolGen() {
size = DEFAULT_BUFFER_SIZE;
constants = new Constant[size];
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ConstantPoolGen.java
示例8: getFinalConstantPool
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/**
* @return constant pool with proper length
*/
public ConstantPool getFinalConstantPool() {
final Constant[] cs = new Constant[index];
System.arraycopy(constants, 0, cs, 0, index);
return new ConstantPool(cs);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:ConstantPoolGen.java
示例9: getConstant
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/**
* @param i index in constant pool
* @return constant pool entry at index i
*/
public Constant getConstant(final int i) {
return constants[i];
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ConstantPoolGen.java
示例10: setConstant
import com.sun.org.apache.bcel.internal.classfile.Constant; //导入依赖的package包/类
/**
* Use with care!
*
* @param i index in constant pool
* @param c new constant pool entry at index i
*/
public void setConstant(final int i, final Constant c) {
constants[i] = c;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:ConstantPoolGen.java
注:本文中的com.sun.org.apache.bcel.internal.classfile.Constant类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论