public int compare(Constant a, Constant b) { int ret; ret = countUses.get(b) - countUses.get(a); if (ret == 0) { /* * Provide sorting determinisim for constants with same * usage count. */ ret = a.compareTo(b); } return ret; }
/** * {@inheritDoc} * * This compares in class-major and value-minor order. */ public final int compareTo(Constant other) { Class clazz = getClass(); Class otherClazz = other.getClass(); if (clazz != otherClazz) { return clazz.getName().compareTo(otherClazz.getName()); } return compareTo0(other); }
/** {@inheritDoc} */ @Override public String getInlineString() { return cst.toHuman(); }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
private void checkConstMethodHandleSupported(Constant cst) throws SimException { if (!dexOptions.apiIsSupported(DexFormat.API_CONST_METHOD_HANDLE)) { fail(String.format("invalid constant type %s requires --min-sdk-version >= %d " + "(currently %d)", cst.typeName(), DexFormat.API_CONST_METHOD_HANDLE, dexOptions.minSdkVersion)); } }
throwIfImmutable(); boolean cat2 = (cst != null) && cst.isCategory2(); if ((prev != null) && prev.isCategory2()) { entries[n - 1] = null;
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
/** {@inheritDoc} */ @Override public String cstComment() { if (!hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); sb.append(getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); } }
throwIfImmutable(); boolean cat2 = (cst != null) && cst.isCategory2(); if ((prev != null) && prev.isCategory2()) { entries[n - 1] = null;
/** {@inheritDoc} */ @Override protected String argString() { return constant.toHuman(); }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
public int compare(Constant a, Constant b) { int ret; ret = countUses.get(b) - countUses.get(a); if (ret == 0) { /* * Provide sorting determinisim for constants with same * usage count. */ ret = a.compareTo(b); } return ret; }
/** {@inheritDoc} */ @Override public String cstComment() { if (!hasIndex()) { return ""; } StringBuilder sb = new StringBuilder(20); sb.append(getConstant().typeName()); sb.append('@'); if (index < 65536) { sb.append(Hex.u2(index)); } else { sb.append(Hex.u4(index)); } return sb.toString(); } }
/** * {@inheritDoc} * * This compares in class-major and value-minor order. */ public final int compareTo(Constant other) { Class clazz = getClass(); Class otherClazz = other.getClass(); if (clazz != otherClazz) { return clazz.getName().compareTo(otherClazz.getName()); } return compareTo0(other); }
throwIfImmutable(); boolean cat2 = (cst != null) && cst.isCategory2(); if ((prev != null) && prev.isCategory2()) { entries[n - 1] = null;
/** {@inheritDoc} */ @Override protected String argString() { return constant.toHuman(); } }
/** * Gets the colloquial type name and human form of the type of the * given constant, when used as an encoded value. * * @param cst {@code non-null;} the constant * @return {@code non-null;} its type name and human form */ public static String constantToHuman(Constant cst) { int type = constantToValueType(cst); if (type == VALUE_NULL) { return "null"; } StringBuilder sb = new StringBuilder(); sb.append(cst.typeName()); sb.append(' '); sb.append(cst.toHuman()); return sb.toString(); }
public int compare(Constant a, Constant b) { int ret; ret = countUses.get(b) - countUses.get(a); if (ret == 0) { /* * Provide sorting determinisim for constants with same * usage count. */ ret = a.compareTo(b); } return ret; }
/** {@inheritDoc} */ @Override public String cstComment() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < constants.length; ++i) { if (!hasIndex(i)) { return ""; } if (i > 0) { sb.append(", "); } sb.append(getConstant(i).typeName()); sb.append('@'); final int currentIndex = getIndex(i); if (currentIndex < 65536) { sb.append(Hex.u2(currentIndex)); } else { sb.append(Hex.u4(currentIndex)); } } return sb.toString(); } }
/** * {@inheritDoc} * * This compares in class-major and value-minor order. */ public final int compareTo(Constant other) { Class clazz = getClass(); Class otherClazz = other.getClass(); if (clazz != otherClazz) { return clazz.getName().compareTo(otherClazz.getName()); } return compareTo0(other); }