Methods Summary |
---|
public IndexedItem | get(com.android.dexgen.rop.cst.Constant cst){@inheritDoc}
if (cst == null) {
throw new NullPointerException("cst == null");
}
throwIfNotPrepared();
if (cst instanceof CstString) {
cst = ((CstString) cst).getString();
}
IndexedItem result = strings.get((CstUtf8) cst);
if (result == null) {
throw new IllegalArgumentException("not found");
}
return result;
|
public int | indexOf(com.android.dexgen.rop.cst.CstUtf8 string)Gets the index of the given string, which must have been added
to this instance.
if (string == null) {
throw new NullPointerException("string == null");
}
throwIfNotPrepared();
StringIdItem s = strings.get(string);
if (s == null) {
throw new IllegalArgumentException("not found");
}
return s.getIndex();
|
public int | indexOf(com.android.dexgen.rop.cst.CstString string)Gets the index of the given string, which must have been added
to this instance.
return indexOf(string.getString());
|
public StringIdItem | intern(java.lang.String string)Interns an element into this instance.
CstUtf8 utf8 = new CstUtf8(string);
return intern(new StringIdItem(utf8));
|
public StringIdItem | intern(com.android.dexgen.rop.cst.CstString string)Interns an element into this instance.
CstUtf8 utf8 = string.getString();
return intern(new StringIdItem(utf8));
|
public StringIdItem | intern(com.android.dexgen.rop.cst.CstUtf8 string)Interns an element into this instance.
return intern(new StringIdItem(string));
|
public StringIdItem | intern(StringIdItem string)Interns an element into this instance.
if (string == null) {
throw new NullPointerException("string == null");
}
throwIfPrepared();
CstUtf8 value = string.getValue();
StringIdItem already = strings.get(value);
if (already != null) {
return already;
}
strings.put(value, string);
return string;
|
public void | intern(com.android.dexgen.rop.cst.CstNat nat)Interns the components of a name-and-type into this instance.
intern(nat.getName());
intern(nat.getDescriptor());
|
public java.util.Collection | items(){@inheritDoc}
return strings.values();
|
protected void | orderItems(){@inheritDoc}
int idx = 0;
for (StringIdItem s : strings.values()) {
s.setIndex(idx);
idx++;
}
|
public void | writeHeaderPart(com.android.dexgen.util.AnnotatedOutput out)Writes the portion of the file header that refers to this instance.
throwIfNotPrepared();
int sz = strings.size();
int offset = (sz == 0) ? 0 : getFileOffset();
if (out.annotates()) {
out.annotate(4, "string_ids_size: " + Hex.u4(sz));
out.annotate(4, "string_ids_off: " + Hex.u4(offset));
}
out.writeInt(sz);
out.writeInt(offset);
|