public int getTag(int constantIndex) { return constantPool[constantIndex].getTag(); }
public int getTag(int constantIndex) { return constantPool[constantIndex].getTag(); }
public int getTag(int constantIndex) { return constantPool[constantIndex].getTag(); }
public int getTag(int constantIndex) { return constantPool[constantIndex].getTag(); }
public int compareTo(Object other) { ComparableConstant otherComparableConstant = (ComparableConstant)other; otherConstant = otherComparableConstant.thisConstant; // Compare based on the original indices, if the actual constant pool // entries are the same. if (thisConstant == otherConstant) { int otherIndex = otherComparableConstant.thisIndex; return thisIndex < otherIndex ? -1 : thisIndex == otherIndex ? 0 : 1; } // Compare based on the tags, if they are different. int thisTag = thisConstant.getTag(); int otherTag = otherConstant.getTag(); if (thisTag != otherTag) { return PRIORITIES[thisTag] < PRIORITIES[otherTag] ? -1 : 1; } // Otherwise compare based on the contents of the Constant objects. thisConstant.accept(clazz, this); return result; }
public void visitAnyConstant(Clazz clazz, Constant constant) { if (((1 << constant.getTag()) & constantTagMask) != 0) { constant.accept(clazz, constantVisitor); } } }
public void visitAnyConstant(Clazz clazz, Constant constant) { if (((1 << constant.getTag()) & constantTagMask) != 0) { constant.accept(clazz, constantVisitor); } } }
public void visitAnyConstant(Clazz clazz, Constant constant) { if (((1 << constant.getTag()) & constantTagMask) != 0) { constant.accept(clazz, constantVisitor); } } }
public int compareTo(Object other) { ComparableConstant otherComparableConstant = (ComparableConstant)other; otherConstant = otherComparableConstant.thisConstant; // Compare based on the original indices, if the actual constant pool // entries are the same. if (thisConstant == otherConstant) { int otherIndex = otherComparableConstant.thisIndex; return thisIndex < otherIndex ? -1 : thisIndex == otherIndex ? 0 : 1; } // Compare based on the tags, if they are different. int thisTag = thisConstant.getTag(); int otherTag = otherConstant.getTag(); if (thisTag != otherTag) { return PRIORITIES[thisTag] < PRIORITIES[otherTag] ? -1 : 1; } // Otherwise compare based on the contents of the Constant objects. thisConstant.accept(clazz, this); return result; }
public int compareTo(Object other) { ComparableConstant otherComparableConstant = (ComparableConstant)other; otherConstant = otherComparableConstant.thisConstant; // Compare based on the original indices, if the actual constant pool // entries are the same. if (thisConstant == otherConstant) { int otherIndex = otherComparableConstant.thisIndex; return thisIndex < otherIndex ? -1 : thisIndex == otherIndex ? 0 : 1; } // Compare based on the tags, if they are different. int thisTag = thisConstant.getTag(); int otherTag = otherConstant.getTag(); if (thisTag != otherTag) { return PRIORITIES[thisTag] < PRIORITIES[otherTag] ? -1 : 1; } // Otherwise compare based on the contents of the Constant objects. thisConstant.accept(clazz, this); return result; }
public int compareTo(Object other) { ComparableConstant otherComparableConstant = (ComparableConstant)other; otherConstant = otherComparableConstant.thisConstant; // Compare based on the original indices, if the actual constant pool // entries are the same. if (thisConstant == otherConstant) { int otherIndex = otherComparableConstant.thisIndex; return thisIndex < otherIndex ? -1 : thisIndex == otherIndex ? 0 : 1; } // Compare based on the tags, if they are different. int thisTag = thisConstant.getTag(); int otherTag = otherConstant.getTag(); if (thisTag != otherTag) { return PRIORITIES[thisTag] < PRIORITIES[otherTag] ? -1 : 1; } // Otherwise compare based on the contents of the Constant objects. thisConstant.accept(clazz, this); return result; }
public void visitAnyConstant(Clazz clazz, Constant constant) { // Write the tag. dataOutput.writeByte(constant.getTag()); // Write the actual body. constant.accept(clazz, constantBodyWriter); }
public void visitAnyConstant(Clazz clazz, Constant constant) { // Write the tag. dataOutput.writeByte(constant.getTag()); // Write the actual body. constant.accept(clazz, constantBodyWriter); }
public void visitAnyConstant(Clazz clazz, Constant constant) { // Write the tag. dataOutput.writeByte(constant.getTag()); // Write the actual body. constant.accept(clazz, constantBodyWriter); }
public void visitAnyConstant(Clazz clazz, Constant constant) { // Write the tag. dataOutput.writeByte(constant.getTag()); // Write the actual body. constant.accept(clazz, constantBodyWriter); }
/** * Finds or creates a Utf8Constant constant pool entry for the given string. * @return the constant pool index of the Utf8Constant. */ public int addUtf8Constant(String string) { int constantPoolCount = targetClass.u2constantPoolCount; Constant[] constantPool = targetClass.constantPool; // Check if the entry already exists. for (int index = 1; index < constantPoolCount; index++) { Constant constant = constantPool[index]; if (constant != null && constant.getTag() == ClassConstants.CONSTANT_Utf8) { Utf8Constant utf8Constant = (Utf8Constant)constant; if (utf8Constant.getString().equals(string)) { return index; } } } return addConstant(new Utf8Constant(string)); }
/** * Finds or creates a Utf8Constant constant pool entry for the given string. * @return the constant pool index of the Utf8Constant. */ public int addUtf8Constant(String string) { int constantPoolCount = targetClass.u2constantPoolCount; Constant[] constantPool = targetClass.constantPool; // Check if the entry already exists. for (int index = 1; index < constantPoolCount; index++) { Constant constant = constantPool[index]; if (constant != null && constant.getTag() == ClassConstants.CONSTANT_Utf8) { Utf8Constant utf8Constant = (Utf8Constant)constant; if (utf8Constant.getString().equals(string)) { return index; } } } return addConstant(new Utf8Constant(string)); }
/** * Finds or creates a LongConstant constant pool entry with the given value. * @return the constant pool index of the LongConstant. */ public int addLongConstant(long value) { int constantPoolCount = targetClass.u2constantPoolCount; Constant[] constantPool = targetClass.constantPool; // Check if the entry already exists. for (int index = 1; index < constantPoolCount; index++) { Constant constant = constantPool[index]; if (constant != null && constant.getTag() == ClassConstants.CONSTANT_Long) { LongConstant longConstant = (LongConstant)constant; if (longConstant.getValue() == value) { return index; } } } return addConstant(new LongConstant(value)); }
/** * Finds or creates a FloatConstant constant pool entry with the given * value. * @return the constant pool index of the FloatConstant. */ public int addFloatConstant(float value) { int constantPoolCount = targetClass.u2constantPoolCount; Constant[] constantPool = targetClass.constantPool; // Check if the entry already exists. for (int index = 1; index < constantPoolCount; index++) { Constant constant = constantPool[index]; if (constant != null && constant.getTag() == ClassConstants.CONSTANT_Float) { FloatConstant floatConstant = (FloatConstant)constant; if (floatConstant.getValue() == value) { return index; } } } return addConstant(new FloatConstant(value)); }
/** * Finds or creates a LongConstant constant pool entry with the given value. * @return the constant pool index of the LongConstant. */ public int addLongConstant(long value) { int constantPoolCount = targetClass.u2constantPoolCount; Constant[] constantPool = targetClass.constantPool; // Check if the entry already exists. for (int index = 1; index < constantPoolCount; index++) { Constant constant = constantPool[index]; if (constant != null && constant.getTag() == ClassConstants.CONSTANT_Long) { LongConstant longConstant = (LongConstant)constant; if (longConstant.getValue() == value) { return index; } } } return addConstant(new LongConstant(value)); }